mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
util: get rid of unnecessary umask() call
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
aaaa2d56bd
commit
d00c6fd258
@ -545,17 +545,15 @@ virPidFileConstructPath(bool privileged,
|
||||
if (virAsprintf(pidfile, "%s/run/%s.pid", statedir, progname) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
mode_t old_umask;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
goto cleanup;
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(rundir) < 0) {
|
||||
umask(old_umask);
|
||||
if (virFileMakePathWithMode(rundir, 0700) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Cannot create user runtime directory '%s'"),
|
||||
rundir);
|
||||
goto cleanup;
|
||||
}
|
||||
umask(old_umask);
|
||||
|
||||
if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0) {
|
||||
VIR_FREE(rundir);
|
||||
|
Loading…
Reference in New Issue
Block a user