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)
commitc226b7c2fdd6cc4357337514b22c3042195ab091
treeaaa0111e953f51c38232616addfd0ca8e0ab3292
parent5865fcdd6370cef7d3a4997500a9a28f3114ad7f
Move the initialization of push_dir, which calls getcwd, to early in main.
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.
clientserver.c
main.c
util.c