Merge pull request #9145 from poettering/itsy-bitsy-fixes

trivial fixes
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-05-31 13:38:53 +02:00 committed by GitHub
commit 8d96289711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 18 deletions

View file

@ -45,7 +45,6 @@
<para>Most of <command>systemd-portabled</command>'s functionality is accessible through the
<citerefentry><refentrytitle>portablectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> command.</para>
<para>See the <ulink url="https://github.com/systemd/systemd/blob/master/doc/PORTABLE_SERVICES.md">Portable
Services Documentation</ulink> for details about the concepts this service implements.</para>
</refsect1>

View file

@ -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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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");

View file

@ -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);
}

View file

@ -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();
}