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

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

Issue 776883002: pylint: upgrade to 1.4.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
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
===================================================================
--- third_party/logilab/common/daemon.py (revision 293207)
+++ third_party/logilab/common/daemon.py (working copy)
@@ -51,7 +51,7 @@
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 @@
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 @@
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