Browse Source

More accurate check of file descriptors

Alexander Smirnov 11 năm trước cách đây
mục cha
commit
fbe90ac07b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      celery/platforms.py

+ 1 - 1
celery/platforms.py

@@ -292,7 +292,7 @@ class DaemonContext(object):
         self.stdfds = (sys.stdin, sys.stdout, sys.stderr)
 
     def redirect_to_null(self, fd):
-        if fd:
+        if fd is not None:
             dest = os.open(os.devnull, os.O_RDWR)
             os.dup2(dest, fd)