summaryrefslogtreecommitdiff
path: root/src/basic/fd-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-29 16:19:33 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit68c6478b75e681581b2de4be275995fcb4b50b26 (patch)
treef839659d6ba9beecf2cad1a057d6b54a36f5f0c2 /src/basic/fd-util.h
parentafe009a2dcf9b5e5908878e712bbe8cce170b41e (diff)
tmpfiles: add a new return code for "operational failure" when processing
Things can fail, and we have no control over it: - file system issues (immutable bits, file system errors, MAC refusals, etc) - kernel refusing certain arguments when writing to /proc/sys or /sys Let's add a new code for the case where we parsed configuration but failed to execute it because of external errors.
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r--src/basic/fd-util.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index 0f5a950f1..db259e6d1 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -102,6 +102,10 @@ int acquire_data_fd(const void *data, size_t size, unsigned flags);
#define ERRNO_IS_DISCONNECT(r) \
IN_SET(r, ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE, ENETUNREACH)
+/* Resource exhaustion, could be our fault or general system trouble */
+#define ERRNO_IS_RESOURCE(r) \
+ IN_SET(r, ENOMEM, EMFILE, ENFILE)
+
int fd_move_above_stdio(int fd);
int rearrange_stdio(int original_input_fd, int original_output_fd, int original_error_fd);
@@ -117,5 +121,3 @@ static inline int make_null_stdio(void) {
(fd) = -1; \
_fd_; \
})
-
-int fd_reopen(int fd, int flags);