X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fbasic%2Frlimit-util.c;h=00648211d33820120c4d1c5c76b9b0b1ca7b0892;hb=53e1b683907c2f12330f00feb9630150196f064d;hp=ee063720edb15abc9c9694ea247f3b0c8515e1a8;hpb=29857001854a02c292f1f3b324e7a66831e859c8;p=thirdparty%2Fsystemd.git diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c index ee063720edb..00648211d33 100644 --- a/src/basic/rlimit-util.c +++ b/src/basic/rlimit-util.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ /*** This file is part of systemd. @@ -22,7 +23,7 @@ #include "alloc-util.h" #include "extract-word.h" -#include "formats-util.h" +#include "format-util.h" #include "macro.h" #include "missing.h" #include "rlimit-util.h" @@ -42,7 +43,8 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) { /* So we failed to set the desired setrlimit, then let's try * to get as close as we can */ - assert_se(getrlimit(resource, &highest) == 0); + if (getrlimit(resource, &highest) < 0) + return -errno; fixed.rlim_cur = MIN(rlim->rlim_cur, highest.rlim_max); fixed.rlim_max = MIN(rlim->rlim_max, highest.rlim_max);