equal
deleted
inserted
replaced
493 |
493 |
494 if opts['daemon'] and not opts['daemon_pipefds']: |
494 if opts['daemon'] and not opts['daemon_pipefds']: |
495 rfd, wfd = os.pipe() |
495 rfd, wfd = os.pipe() |
496 args = sys.argv[:] |
496 args = sys.argv[:] |
497 args.append('--daemon-pipefds=%d,%d' % (rfd, wfd)) |
497 args.append('--daemon-pipefds=%d,%d' % (rfd, wfd)) |
|
498 # Don't pass --cwd to the child process, because we've already |
|
499 # changed directory. |
|
500 for i in xrange(1,len(args)): |
|
501 if args[i].startswith('--cwd='): |
|
502 del args[i] |
|
503 break |
|
504 elif args[i].startswith('--cwd'): |
|
505 del args[i:i+2] |
|
506 break |
498 pid = os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), |
507 pid = os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), |
499 args[0], args) |
508 args[0], args) |
500 os.close(wfd) |
509 os.close(wfd) |
501 os.read(rfd, 1) |
510 os.read(rfd, 1) |
502 if parentfn: |
511 if parentfn: |