--- smbmount.c Tue Apr 26 15:35:32 2005 +++ smbmount.c.ori Tue Apr 26 15:35:21 2005 @@ -427,7 +427,7 @@ /** * Mount a smbfs **/ -static int init_mount(void) +static void init_mount(void) { char mount_point[PATH_MAX+1]; pstring tmp; @@ -438,14 +438,14 @@ if (realpath(mpoint, mount_point) == NULL) { fprintf(stderr, "Could not resolve mount point %s\n", mpoint); - return (2); + return; } c = do_connection(service); if (!c) { fprintf(stderr,"SMB connection failed\n"); - return (1); + exit(1); } /* @@ -512,22 +512,22 @@ "smbmnt", strerror(errno)); } free(smbmnt_path); - return(1); + exit(1); } if (waitpid(-1, &status, 0) == -1) { fprintf(stderr,"waitpid failed: Error was %s", strerror(errno) ); /* FIXME: do some proper error handling */ - return(1); + exit(1); } if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { fprintf(stderr,"smbmnt failed: %d\n", WEXITSTATUS(status)); /* FIXME: do some proper error handling */ - return(1); + exit(1); } else if (WIFSIGNALED(status)) { fprintf(stderr, "smbmnt killed by signal %d\n", WTERMSIG(status)); - return(1); + exit(1); } /* Ok... This is the rubicon for that mount point... At any point @@ -936,6 +936,6 @@ } strupper_m(my_netbios_name); - return init_mount(); - + init_mount(); + return 0; }