projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
206a29b
)
errno-util: add ERRNO_IS_PRIVILEGE() helper
author
Lennart Poettering
<lennart@poettering.net>
Wed, 20 Nov 2019 11:22:40 +0000
(12:22 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 20 Nov 2019 11:29:54 +0000
(12:29 +0100)
src/basic/errno-util.h
patch
|
blob
|
history
diff --git
a/src/basic/errno-util.h
b/src/basic/errno-util.h
index
b2723b8
..
8f1be6c
100644
(file)
--- a/
src/basic/errno-util.h
+++ b/
src/basic/errno-util.h
@@
-94,3
+94,10
@@
static inline bool ERRNO_IS_NOT_SUPPORTED(int r) {
ENOTTY,
ENOSYS);
}
+
+/* Two different errors for access problems */
+static inline bool ERRNO_IS_PRIVILEGE(int r) {
+ return IN_SET(abs(r),
+ EACCES,
+ EPERM);
+}