first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / source3 / web / startstop.c
index e60b13ae6693fa91736a42163cf8e9ef9b50234d..9eeac96cc0c795b73b7ad52a2405d42a0bf3de92 100644 (file)
@@ -37,11 +37,11 @@ void start_smbd(void)
                return;
        }
 
-       sprintf(binfile,"%s/smbd", SBINDIR);
+       slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", SBINDIR);
 
        become_daemon();
 
-       execl(binfile, "-D", NULL);
+       execl(binfile, binfile, "-D", NULL);
 
        exit(0);
 }
@@ -58,11 +58,11 @@ void start_nmbd(void)
                return;
        }
 
-       sprintf(binfile,"%s/nmbd", SBINDIR);
+       slprintf(binfile, sizeof(pstring) - 1, "%s/nmbd", SBINDIR);
        
        become_daemon();
 
-       execl(binfile, "-D", NULL);
+       execl(binfile, binfile, "-D", NULL);
 
        exit(0);
 }
@@ -71,7 +71,7 @@ void start_nmbd(void)
 /* stop smbd */
 void stop_smbd(void)
 {
-       unsigned pid = pidfile_pid("smbd");
+       pid_t pid = pidfile_pid("smbd");
 
        if (geteuid() != 0) return;
 
@@ -83,7 +83,7 @@ void stop_smbd(void)
 /* stop nmbd */
 void stop_nmbd(void)
 {
-       unsigned pid = pidfile_pid("nmbd");
+       pid_t pid = pidfile_pid("nmbd");
 
        if (geteuid() != 0) return;
 
@@ -93,7 +93,7 @@ void stop_nmbd(void)
 }
 
 /* kill a specified process */
-void kill_pid(int pid)
+void kill_pid(pid_t pid)
 {
        if (geteuid() != 0) return;