rlimit-util: log when falling back setting limit

This commit is contained in:
Pierre Dubouilh
2021-02-15 15:30:35 +01:00
committed by Lennart Poettering
parent 458ab40f35
commit 1edebb0b89
+2
View File
@@ -43,6 +43,8 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
fixed.rlim_max == highest.rlim_max)
return 0;
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;