X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmachine%2Fmachinectl.c;h=6337aa274fd5ada55986abecc00e3b053e43fb9a;hb=67608cad2301f9ab5c92336992c176505640f2ba;hp=2183d5c397baed61b62f2fb824f8dc6d6424a753;hpb=1dba654b27918c22e413ac5b3c19301f1ff86ad2;p=elogind.git diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 2183d5c39..6337aa274 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -412,7 +412,7 @@ static int terminate_machine(sd_bus *bus, char **args, unsigned n) { } static int openpt_in_namespace(pid_t pid, int flags) { - _cleanup_close_pipe_ int pair[2] = { -1, -1 }; + _cleanup_close_pair_ int pair[2] = { -1, -1 }; _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1; union { struct cmsghdr cmsghdr; @@ -439,8 +439,7 @@ static int openpt_in_namespace(pid_t pid, int flags) { return -errno; if (child == 0) { - close_nointr_nofail(pair[0]); - pair[0] = -1; + pair[0] = safe_close(pair[0]); r = namespace_enter(pidnsfd, mntnsfd, rootfd); if (r < 0) @@ -464,8 +463,7 @@ static int openpt_in_namespace(pid_t pid, int flags) { _exit(EXIT_SUCCESS); } - close_nointr_nofail(pair[1]); - pair[1] = -1; + pair[1] = safe_close(pair[1]); r = wait_for_terminate(child, &si); if (r < 0 || si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS) {