Added
Link Here
|
1 |
FreeBSD < 13 lacks https://cgit.freebsd.org/src/commit/?id=af755d3e4859 |
2 |
|
3 |
src/utils/ramfile.cpp:57:117: error: use of undeclared identifier 'errno' |
4 |
qCWarning(KWIN_CORE).nospace() << name << ": Failed to remove temporary file from filesystem: " << strerror(errno); |
5 |
^ |
6 |
src/utils/ramfile.cpp:80:17: error: use of undeclared identifier 'F_SEAL_SHRINK' |
7 |
int seals = F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL; |
8 |
^ |
9 |
src/utils/ramfile.cpp:80:33: error: use of undeclared identifier 'F_SEAL_GROW' |
10 |
int seals = F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL; |
11 |
^ |
12 |
src/utils/ramfile.cpp:80:47: error: use of undeclared identifier 'F_SEAL_SEAL' |
13 |
int seals = F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL; |
14 |
^ |
15 |
src/utils/ramfile.cpp:82:18: error: use of undeclared identifier 'F_SEAL_WRITE' |
16 |
seals |= F_SEAL_WRITE; |
17 |
^ |
18 |
src/utils/ramfile.cpp:85:21: error: use of undeclared identifier 'F_ADD_SEALS' |
19 |
if (fcntl(fd(), F_ADD_SEALS, seals) != 0) { |
20 |
^ |
21 |
src/utils/ramfile.cpp:139:35: error: use of undeclared identifier 'F_GET_SEALS' |
22 |
const int seals = fcntl(fd(), F_GET_SEALS); |
23 |
^ |
24 |
src/utils/ramfile.cpp:141:21: error: use of undeclared identifier 'F_SEAL_WRITE' |
25 |
if (seals & F_SEAL_WRITE) { |
26 |
^ |
27 |
|
28 |
--- src/utils/ramfile.cpp.orig 2023-01-03 18:08:37 UTC |
29 |
+++ src/utils/ramfile.cpp |
30 |
@@ -16,6 +16,7 @@ |
31 |
#include <fcntl.h> |
32 |
#include <sys/mman.h> |
33 |
#include <unistd.h> |
34 |
+#include <cerrno> |
35 |
#include <utility> |
36 |
|
37 |
namespace KWin |
38 |
@@ -77,6 +78,7 @@ RamFile::RamFile(const char *name, const void *inData, |
39 |
m_tmp->unmap(data); |
40 |
#endif |
41 |
|
42 |
+#ifdef F_SEAL_SEAL |
43 |
int seals = F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL; |
44 |
if (flags.testFlag(RamFile::Flag::SealWrite)) { |
45 |
seals |= F_SEAL_WRITE; |
46 |
@@ -85,6 +87,7 @@ RamFile::RamFile(const char *name, const void *inData, |
47 |
if (fcntl(fd(), F_ADD_SEALS, seals) != 0) { |
48 |
qCDebug(KWIN_CORE).nospace() << name << ": Failed to seal RamFile: " << strerror(errno); |
49 |
} |
50 |
+#endif |
51 |
|
52 |
guard.dismiss(); |
53 |
} |
54 |
@@ -136,12 +139,14 @@ RamFile::Flags RamFile::effectiveFlags() const |
55 |
{ |
56 |
Flags flags = {}; |
57 |
|
58 |
+#ifdef F_SEAL_SEAL |
59 |
const int seals = fcntl(fd(), F_GET_SEALS); |
60 |
if (seals > 0) { |
61 |
if (seals & F_SEAL_WRITE) { |
62 |
flags.setFlag(Flag::SealWrite); |
63 |
} |
64 |
} |
65 |
+#endif |
66 |
|
67 |
return flags; |
68 |
} |