Revision: shell-utils--lord--1.0--patch-7
Archive: lord@regexps.com--2002
Creator: Tom Lord <lord@regexps.com>
Date: Wed Feb  6 15:33:05 PST 2002
Standard-date: 2002-02-06
Summary: don't panic if there's no cwd in `as-daemon'
Keywords: 
New-files: =THANKS
  {arch}/shell-utils/shell-utils--lord/shell-utils--lord--1.0/lord@regexps.com--2002/patch-log/patch-7
Modified-files: ChangeLog ChangeLog.d/lord@regexps.com--2002/ChangeLog.lord
  as-daemon.c
New-patches: lord@regexps.com--2002/shell-utils--lord--1.0--patch-7


A race condition can lead to some marginally reasonable uses of
`as-daemon' running with a non-existent cwd.  Rather than panic in
this case, just note that the cwd is non-existent.

Also, compute the cwd before becoming a daemon, so the race condition
is eliminated.  (There is still a race between becoming a daemon and
fork/execing the sub-process -- so the command invoked by as-daemon
can wind up with no cwd.)

(Corresponding changes are needed in arch clients to make sure
as-daemon is *not* invoked with a cwd that is about to be deleted.)

