summaryrefslogtreecommitdiff
path: root/source3/client/smbmount.c
diff options
context:
space:
mode:
authorMichael Warfield <mhw@samba.org>1998-11-30 18:06:29 +0000
committerMichael Warfield <mhw@samba.org>1998-11-30 18:06:29 +0000
commitda7a6d46b01c77e243b3cbc7bf23c3b7aa6e13e9 (patch)
tree7227f31aa6a0e6f842acabbe5f960710088ac89e /source3/client/smbmount.c
parent0712a56047f41d994bdb12eb15b96e6ce55b8f5b (diff)
downloadsamba-da7a6d46b01c77e243b3cbc7bf23c3b7aa6e13e9.tar.gz
samba-da7a6d46b01c77e243b3cbc7bf23c3b7aa6e13e9.tar.bz2
samba-da7a6d46b01c77e243b3cbc7bf23c3b7aa6e13e9.zip
Earlier fix for smbmount timing window was the wrong patch.
My bad... Earlier one was the patch from the CIFS conference that didn't work, this fixes... (This used to be commit 12739f0456e9f707a361bce2fa01b0baaae182d9)
Diffstat (limited to 'source3/client/smbmount.c')
-rw-r--r--source3/client/smbmount.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index 364c28cdcd..2cfd166688 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -255,6 +255,7 @@ static void
send_fs_socket(char *mount_point, char *inbuf, char *outbuf)
{
int fd, closed = 0, res = 1;
+ int first_time = 1;
while (1)
{
@@ -290,6 +291,15 @@ send_fs_socket(char *mount_point, char *inbuf, char *outbuf)
}
#endif
+ if( first_time ) {
+ /*
+ * Create the background process after trying the mount.
+ * to avoid race conditions with automount and other processes.
+ */
+ first_time = 0;
+ daemonize();
+ }
+
/*
* Wait for a signal from smbfs ...
*/
@@ -364,15 +374,6 @@ static void cmd_mount(char *inbuf,char *outbuf)
exit(1);
}
- /*
- * Create the background process after trying the mount.
- * to avoid race conditions with automount and other processes.
- */
- daemonize();
-
- /* The parent has exited here, leave the daemon to deal with
- * disconnects and reconnects
- */
send_fs_socket(mount_point, inbuf, outbuf);
}