diff --git a/man/systemd-portabled.service.xml b/man/systemd-portabled.service.xml index 7b1c3ae68c..91da27eba8 100644 --- a/man/systemd-portabled.service.xml +++ b/man/systemd-portabled.service.xml @@ -45,7 +45,6 @@ Most of systemd-portabled's functionality is accessible through the portablectl1 command. - See the Portable Services Documentation for details about the concepts this service implements. diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 2548c989a9..5792ae9587 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1952,7 +1952,7 @@ static int setup_kmsg(int kmsg_socket) { if (r < 0) return r; - fd = open(from, O_RDWR|O_NDELAY|O_CLOEXEC); + fd = open(from, O_RDWR|O_NONBLOCK|O_CLOEXEC); if (fd < 0) return log_error_errno(errno, "Failed to open fifo: %m"); @@ -4478,7 +4478,7 @@ int main(int argc, char *argv[]) { isatty(STDIN_FILENO) > 0 && isatty(STDOUT_FILENO) > 0; - master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); + master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK); if (master < 0) { r = log_error_errno(errno, "Failed to acquire pseudo tty: %m"); goto finish; diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 200435caae..4051875b76 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -104,8 +104,7 @@ static int extract_prefix(const char *path, char **ret) { if (!filename_is_valid(name)) return -EINVAL; - *ret = name; - name = NULL; + *ret = TAKE_PTR(name); return 0; } @@ -142,18 +141,20 @@ static int determine_matches(const char *image, char **l, bool allow_any, char * if (!arg_quiet) log_info("(Matching all unit files.)"); } else { - _cleanup_free_ char *joined = NULL; k = strv_copy(l); if (!k) return log_oom(); - joined = strv_join(k, "', '"); - if (!joined) - return log_oom(); + if (!arg_quiet) { + _cleanup_free_ char *joined = NULL; + + joined = strv_join(k, "', '"); + if (!joined) + return log_oom(); - if (!arg_quiet) log_info("(Matching unit files with prefixes '%s'.)", joined); + } } *ret = TAKE_PTR(k); @@ -883,14 +884,14 @@ static int parse_argv(int argc, char *argv[]) { break; case 'p': + if (streq(optarg, "help")) + return dump_profiles(); + if (!filename_is_valid(optarg)) { log_error("Unit profile name not valid: %s", optarg); return -EINVAL; } - if (streq(optarg, "help")) - return dump_profiles(); - arg_profile = optarg; break; @@ -899,7 +900,12 @@ static int parse_argv(int argc, char *argv[]) { arg_copy_mode = NULL; else if (STR_IN_SET(optarg, "copy", "symlink")) arg_copy_mode = optarg; - else { + else if (streq(optarg, "help")) { + puts("auto\n" + "copy\n" + "symlink"); + return 0; + } else { log_error("Failed to parse --copy= argument: %s", optarg); return -EINVAL; } diff --git a/src/portable/portabled-image-bus.c b/src/portable/portabled-image-bus.c index 1dc6b77b3b..02a2db2352 100644 --- a/src/portable/portabled-image-bus.c +++ b/src/portable/portabled-image-bus.c @@ -156,7 +156,6 @@ int bus_image_common_get_metadata( for (i = 0; i < hashmap_size(unit_files); i++) { - r = sd_bus_message_open_container(reply, 'e', "say"); if (r < 0) return r; diff --git a/src/run/run.c b/src/run/run.c index 6a271eed75..733daffb8c 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -917,7 +917,7 @@ static int start_transient_service( if (arg_stdio == ARG_STDIO_PTY) { if (arg_transport == BUS_TRANSPORT_LOCAL) { - master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY); + master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK); if (master < 0) return log_error_errno(errno, "Failed to acquire pseudo tty: %m"); diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c index 1c5b56f4a0..4717423254 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -30,7 +30,7 @@ static int test_fiemap(const char *path) { if (fd < 0) return log_error_errno(errno, "failed to open %s: %m", path); r = read_fiemap(fd, &fiemap); - if (r == -ENOTSUP) { + if (r == -EOPNOTSUPP) { log_info("Skipping test, not supported"); exit(EXIT_TEST_SKIP); } diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 049e24b8bd..ae39d720a2 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1245,7 +1245,7 @@ static int write_one_file(Item *i, const char *path) { RUN_WITH_UMASK(0000) { mac_selinux_create_file_prepare(path, S_IFREG); - fd = open(path, flags|O_NDELAY|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode); + fd = open(path, flags|O_NONBLOCK|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode); mac_selinux_create_file_clear(); }