mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
util: remove pointless wrappers for setrlimit/getrlimit
These wrappers added no semantic difference over calling the system function directly. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
427eef8959
commit
3967174d03
@ -736,24 +736,6 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WITH_GETRLIMIT
|
|
||||||
static int
|
|
||||||
virProcessGetRLimit(int resource,
|
|
||||||
struct rlimit *old_limit)
|
|
||||||
{
|
|
||||||
return getrlimit(resource, old_limit);
|
|
||||||
}
|
|
||||||
#endif /* WITH_GETRLIMIT */
|
|
||||||
|
|
||||||
#if WITH_SETRLIMIT
|
|
||||||
static int
|
|
||||||
virProcessSetRLimit(int resource,
|
|
||||||
const struct rlimit *new_limit)
|
|
||||||
{
|
|
||||||
return setrlimit(resource, new_limit);
|
|
||||||
}
|
|
||||||
#endif /* WITH_SETRLIMIT */
|
|
||||||
|
|
||||||
#if WITH_GETRLIMIT
|
#if WITH_GETRLIMIT
|
||||||
static const char*
|
static const char*
|
||||||
virProcessLimitResourceToLabel(int resource)
|
virProcessLimitResourceToLabel(int resource)
|
||||||
@ -876,7 +858,7 @@ virProcessGetLimit(pid_t pid,
|
|||||||
if (virProcessGetLimitFromProc(pid, resource, old_limit) == 0)
|
if (virProcessGetLimitFromProc(pid, resource, old_limit) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (same_process && virProcessGetRLimit(resource, old_limit) == 0)
|
if (same_process && getrlimit(resource, old_limit) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -895,7 +877,7 @@ virProcessSetLimit(pid_t pid,
|
|||||||
if (virProcessPrLimit(pid, resource, new_limit, NULL) == 0)
|
if (virProcessPrLimit(pid, resource, new_limit, NULL) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (same_process && virProcessSetRLimit(resource, new_limit) == 0)
|
if (same_process && setrlimit(resource, new_limit) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user