chiark / gitweb /
tmpfiles: add a new return code for "operational failure" when processing
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 29 Mar 2018 14:19:33 +0000 (16:19 +0200)
committerSven Eden <yamakuzure@gmx.net>
Thu, 28 Jun 2018 07:24:07 +0000 (09:24 +0200)
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.

(cherry picked from commit bb9947be2fa308d198b63b30e494ade5d68e5109)

src/basic/fd-util.h

index 838dd5937322c4d7b2b34874e85f66285e5951c1..4cdd01bee18b9530d470ad12044d9fa52934123c 100644 (file)
@@ -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);