Move the initialization of push_dir, which calls getcwd, to early in main.
authorDavid Dykstra <dwd@samba.org>
Wed, 3 Feb 1999 15:38:06 +0000 (15:38 +0000)
committerDavid Dykstra <dwd@samba.org>
Wed, 3 Feb 1999 15:38:06 +0000 (15:38 +0000)
The reason for that is that on SVR2-based UTS 2.1.2 (which along with many
other old systems implements getcwd by forking "pwd") getcwd hangs when
called when other child processes are running.

I also added a quick return from push_dir if name == NULL so it doesn't
actually have to chdir anywhere when just initializing.

An initializing call to push_dir("/",0) had previously been put in at the
beginning of daemon_main() to avoid calling getcwd after a chroot, but
since that is no longer I needed I removed it and changed the call to
chdir("/") after chroot into a push_dir("/",0) so it will remember the
correct current directory.


No differences found