diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2014-09-07 20:09:36 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2014-09-17 13:29:00 -0600 |
commit | 818c5c6b83cfff746cd3bff01d660e480bc84f71 (patch) | |
tree | 8f7ab82bd080db0cdcd5cce722b7e3c622e0efcb | |
parent | a34ec87d2d97787bb62be4325ed2bd8f8ad5a183 (diff) | |
download | libvirt-818c5c6b83cfff746cd3bff01d660e480bc84f71.tar.gz |
util: get rid of unnecessary umask() call
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit d00c6fd25854bfd4822f6ce3d769a8ca132ec31b)
-rw-r--r-- | src/util/virpidfile.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index dd29701a75..a3b8846aae 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -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); |