Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: third_party/logilab/common/daemon.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/common/configuration.py ('k') | third_party/logilab/common/date.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/daemon.py
diff --git a/third_party/logilab/common/daemon.py b/third_party/logilab/common/daemon.py
index 6324b20167ee729900199ea3161dd6d0d2ef12e6..40319a43a7cabba58116feb0ca6331d25c21fd5c 100644
--- a/third_party/logilab/common/daemon.py
+++ b/third_party/logilab/common/daemon.py
@@ -51,7 +51,7 @@ def setugid(user):
os.environ['HOME'] = passwd.pw_dir
-def daemonize(pidfile=None, uid=None, umask=077):
+def daemonize(pidfile=None, uid=None, umask=0o77):
"""daemonize a Unix process. Set paranoid umask by default.
Return 1 in the original process, 2 in the first fork, and None for the
@@ -71,9 +71,6 @@ def daemonize(pidfile=None, uid=None, umask=077):
return 2
# move to the root to avoit mount pb
os.chdir('/')
- # set umask if specified
- if umask is not None:
- os.umask(umask)
# redirect standard descriptors
null = os.open('/dev/null', os.O_RDWR)
for i in range(3):
@@ -95,7 +92,9 @@ def daemonize(pidfile=None, uid=None, umask=077):
f = file(pidfile, 'w')
f.write(str(os.getpid()))
f.close()
- os.chmod(pidfile, 0644)
+ # set umask if specified
+ if umask is not None:
+ os.umask(umask)
# change process uid
if uid:
setugid(uid)
« no previous file with comments | « third_party/logilab/common/configuration.py ('k') | third_party/logilab/common/date.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698