summaryrefslogtreecommitdiffstats
path: root/src/basic/rlimit-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-14 22:40:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-16 08:04:09 +0100
commit7c248223ebafb9bfde9af978cd1ccfc57dcced26 (patch)
tree228bcda6699a2ae88ad01fd1f5f024f2b5d7b0a0 /src/basic/rlimit-util.c
parentmacro: add new helper RET_NERRNO() (diff)
downloadsystemd-7c248223ebafb9bfde9af978cd1ccfc57dcced26.tar.xz
systemd-7c248223ebafb9bfde9af978cd1ccfc57dcced26.zip
tree-wide: use new RET_NERRNO() helper at various places
Diffstat (limited to 'src/basic/rlimit-util.c')
-rw-r--r--src/basic/rlimit-util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
index 1ab41c6974..33dfde9d6c 100644
--- a/src/basic/rlimit-util.c
+++ b/src/basic/rlimit-util.c
@@ -3,6 +3,7 @@
#include <errno.h>
#include "alloc-util.h"
+#include "errno-util.h"
#include "extract-word.h"
#include "fd-util.h"
#include "format-util.h"
@@ -45,10 +46,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
- if (setrlimit(resource, &fixed) < 0)
- return -errno;
-
- return 0;
+ return RET_NERRNO(setrlimit(resource, &fixed));
}
int setrlimit_closest_all(const struct rlimit *const *rlim, int *which_failed) {