comparison mercurial/server.py @ 34924:bfcd0d227972 stable

server: drop executable bit from daemon log file The logfile option was unused, so it was okay until now.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 25 Oct 2017 21:20:01 +0900
parents e48cb1c7a902
children d4a2e0d5d042
comparison
equal deleted inserted replaced
34923:a6a322193a02 34924:bfcd0d227972
91 util.stderr.flush() 91 util.stderr.flush()
92 92
93 nullfd = os.open(os.devnull, os.O_RDWR) 93 nullfd = os.open(os.devnull, os.O_RDWR)
94 logfilefd = nullfd 94 logfilefd = nullfd
95 if logfile: 95 if logfile:
96 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) 96 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND,
97 0o666)
97 os.dup2(nullfd, 0) 98 os.dup2(nullfd, 0)
98 os.dup2(logfilefd, 1) 99 os.dup2(logfilefd, 1)
99 os.dup2(logfilefd, 2) 100 os.dup2(logfilefd, 2)
100 if nullfd not in (0, 1, 2): 101 if nullfd not in (0, 1, 2):
101 os.close(nullfd) 102 os.close(nullfd)