diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 18:23:20 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 18:24:30 +0100 |
commit | 23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 (patch) | |
tree | 28e66fb86dd0cffc3a3cca3cf234cb52c3b64ad3 /src/core/main.c | |
parent | 5e03c6e3b517286bbd65b48d88f60e5b83721894 (diff) |
treewide: more log_*_errno + return simplifications
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/core/main.c b/src/core/main.c index 6224a7ae6b..4acf3f1882 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -231,18 +231,14 @@ static int console_setup(void) { int r; tty_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC); - if (tty_fd < 0) { - log_error_errno(tty_fd, "Failed to open /dev/console: %m"); - return tty_fd; - } + if (tty_fd < 0) + return log_error_errno(tty_fd, "Failed to open /dev/console: %m"); /* We don't want to force text mode. plymouth may be showing * pictures already from initrd. */ r = reset_terminal_fd(tty_fd, false); - if (r < 0) { - log_error_errno(r, "Failed to reset /dev/console: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Failed to reset /dev/console: %m"); return 0; } @@ -806,10 +802,8 @@ static int parse_argv(int argc, char *argv[]) { case ARG_UNIT: r = set_default_unit(optarg); - if (r < 0) { - log_error_errno(r, "Failed to set default unit %s: %m", optarg); - return r; - } + if (r < 0) + return log_error_errno(r, "Failed to set default unit %s: %m", optarg); break; @@ -1070,10 +1064,8 @@ static int bump_rlimit_nofile(struct rlimit *saved_rlimit) { /* Bump up the resource limit for ourselves substantially */ nl.rlim_cur = nl.rlim_max = 64*1024; r = setrlimit_closest(RLIMIT_NOFILE, &nl); - if (r < 0) { - log_error_errno(r, "Setting RLIMIT_NOFILE failed: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Setting RLIMIT_NOFILE failed: %m"); return 0; } |