From 3edd79703a34628e984700b2dfa675accbf680b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 29 Mar 2018 16:19:33 +0200 Subject: [PATCH] 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. (cherry picked from commit bb9947be2fa308d198b63b30e494ade5d68e5109) --- src/basic/fd-util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 838dd5937..4cdd01bee 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); -- 2.30.2