diff options
author | Luca Boccassi <bluca@debian.org> | 2024-11-06 14:51:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-06 14:51:10 +0100 |
commit | d99fe076b58db267b4400415c5b570eb06acb753 (patch) | |
tree | c22387b4263c23998883316408fa746002d64cb5 /src/machine | |
parent | core/manager: silence false-positive warning by coverity (diff) | |
parent | use report_errno_and_exit() in src/core/exec-invoke.c (diff) | |
download | systemd-d99fe076b58db267b4400415c5b570eb06acb753.tar.xz systemd-d99fe076b58db267b4400415c5b570eb06acb753.zip |
introduce report_errno_and_exit() helper (#35028)
This is a follow for https://github.com/systemd/systemd/pull/34853. In
particular, this comment
https://github.com/systemd/systemd/pull/34853#discussion_r1825837705.
Diffstat (limited to 'src/machine')
-rw-r--r-- | src/machine/operation.c | 15 | ||||
-rw-r--r-- | src/machine/operation.h | 2 |
2 files changed, 0 insertions, 17 deletions
diff --git a/src/machine/operation.c b/src/machine/operation.c index 0b2139acf0..7d7bfa5062 100644 --- a/src/machine/operation.c +++ b/src/machine/operation.c @@ -154,18 +154,3 @@ Operation *operation_free(Operation *o) { return mfree(o); } - -_noreturn_ void report_errno_and_exit(int errno_fd, int r) { - if (r >= 0) - _exit(EXIT_SUCCESS); - - assert(errno_fd >= 0); - - ssize_t n = write(errno_fd, &r, sizeof(r)); - if (n < 0) - log_debug_errno(errno, "Failed to write operation's errno: %m"); - if (n != sizeof(r)) - log_debug_errno(SYNTHETIC_ERRNO(EIO), "Sent unexpectedly short message"); - - _exit(EXIT_FAILURE); -} diff --git a/src/machine/operation.h b/src/machine/operation.h index ee9149854a..75bf918c2b 100644 --- a/src/machine/operation.h +++ b/src/machine/operation.h @@ -39,5 +39,3 @@ static inline int operation_new_with_bus_reply(Manager *manager, Machine *machin static inline int operation_new_with_varlink_reply(Manager *manager, Machine *machine, pid_t child, sd_varlink *link, int errno_fd, Operation **ret) { return operation_new(manager, machine, child, /* message = */ NULL, link, errno_fd, ret); } - -void report_errno_and_exit(int errno_fd, int r); |