lib: Remove sys_waitpid
authorVolker Lendecke <vl@samba.org>
Tue, 16 Feb 2016 14:46:06 +0000 (15:46 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 23 Feb 2016 21:03:16 +0000 (22:03 +0100)
We have waitpid in libreplace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/include/proto.h
source3/lib/server_prefork.c
source3/lib/smbrun.c
source3/lib/system.c
source3/lib/tdb_validate.c
source3/printing/queue_process.c
source3/printing/spoolssd.c
source3/rpc_server/samr/srv_samr_chgpasswd.c
source3/smbd/server.c
source3/winbindd/winbindd.c
tests/fcntl_lock_thread.c

index 09e9915..aaa5aee 100644 (file)
@@ -243,7 +243,6 @@ int sys_fallocate(int fd, uint32_t mode, off_t offset, off_t len);
 void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask);
 DIR *sys_fdopendir(int fd);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
-int sys_waitpid(pid_t pid,int *status,int options);
 char *sys_getwd(void);
 void set_effective_capability(enum smbd_capability capability);
 void drop_effective_capability(enum smbd_capability capability);
index c725607..1d64db2 100644 (file)
@@ -329,7 +329,7 @@ static void prefork_cleanup_loop(struct prefork_pool *pfp)
                        continue;
                }
 
-               pid = sys_waitpid(pfp->pool[i].pid, &status, WNOHANG);
+               pid = waitpid(pfp->pool[i].pid, &status, WNOHANG);
                if (pid > 0) {
 
                        if (pfp->pool[i].status != PF_WORKER_EXITING) {
index 55f7a87..63b0323 100644 (file)
@@ -116,7 +116,7 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize)
 
                
                /* the parent just waits for the child to exit */
-               while((wpid = sys_waitpid(pid,&status,0)) < 0) {
+               while((wpid = waitpid(pid,&status,0)) < 0) {
                        if(errno == EINTR) {
                                errno = 0;
                                continue;
@@ -287,7 +287,7 @@ int smbrunsecret(const char *cmd, const char *secret)
                close(ifd[1]);
 
                /* the parent just waits for the child to exit */
-               while((wpid = sys_waitpid(pid, &status, 0)) < 0) {
+               while((wpid = waitpid(pid, &status, 0)) < 0) {
                        if(errno == EINTR) {
                                errno = 0;
                                continue;
index 0351e37..acc121d 100644 (file)
@@ -571,19 +571,6 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev)
 #endif
 }
 
-/*******************************************************************
-The wait() calls vary between systems
-********************************************************************/
-
-int sys_waitpid(pid_t pid,int *status,int options)
-{
-#ifdef HAVE_WAITPID
-       return waitpid(pid,status,options);
-#else /* HAVE_WAITPID */
-       return wait4(pid, status, options, NULL);
-#endif /* HAVE_WAITPID */
-}
-
 /*******************************************************************
  System wrapper for getwd. Always returns MALLOC'ed memory, or NULL
  on error (malloc fail usually).
@@ -1200,7 +1187,7 @@ int sys_pclose(int fd)
         */
 
        do {
-               wait_pid = sys_waitpid (entry->child_pid, &wstatus, 0);
+               wait_pid = waitpid (entry->child_pid, &wstatus, 0);
        } while (wait_pid == -1 && errno == EINTR);
 
        SAFE_FREE(entry);
index 2592402..9db182f 100644 (file)
@@ -135,7 +135,7 @@ int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn)
                (unsigned int)child_pid));
 
        DEBUG(10, ("tdb_validate: waiting for child to finish...\n"));
-       while  ((wait_pid = sys_waitpid(child_pid, &child_status, 0)) < 0) {
+       while  ((wait_pid = waitpid(child_pid, &child_status, 0)) < 0) {
                if (errno == EINTR) {
                        DEBUG(10, ("tdb_validate: got signal during waitpid, "
                                   "retrying\n"));
index 6e31ee4..c9e5522 100644 (file)
@@ -269,7 +269,7 @@ static void bq_sig_chld_handler(struct tevent_context *ev_ctx,
        int status;
        pid_t pid;
 
-       pid = sys_waitpid(-1, &status, WNOHANG);
+       pid = waitpid(-1, &status, WNOHANG);
        if (WIFEXITED(status)) {
                DEBUG(6, ("Bq child process %d terminated with %d\n",
                          (int)pid, WEXITSTATUS(status)));
index 51d10b6..48a914e 100644 (file)
@@ -478,7 +478,7 @@ static void check_updater_child(struct tevent_context *ev_ctx,
                return;
        }
 
-       pid = sys_waitpid(background_lpq_updater_pid, &status, WNOHANG);
+       pid = waitpid(background_lpq_updater_pid, &status, WNOHANG);
        if (pid > 0) {
                DEBUG(2, ("The background queue child died... Restarting!\n"));
                pid = start_background_queue(ev_ctx, msg_ctx, bq_logfile);
index bfb7af6..ad4eaa7 100644 (file)
@@ -430,7 +430,7 @@ static bool chat_with_program(char *passwordprogram, const struct passwd *pass,
                        kill(pid, SIGKILL);     /* be sure to end this process */
                }
 
-               while ((wpid = sys_waitpid(pid, &wstat, 0)) < 0) {
+               while ((wpid = waitpid(pid, &wstat, 0)) < 0) {
                        if (errno == EINTR) {
                                errno = 0;
                                continue;
index 42fcad6..d68615e 100644 (file)
@@ -630,7 +630,7 @@ static void smbd_sig_chld_handler(struct tevent_context *ev,
                talloc_get_type_abort(private_data,
                struct smbd_parent_context);
 
-       while ((pid = sys_waitpid(-1, &status, WNOHANG)) > 0) {
+       while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
                bool unclean_shutdown = False;
 
                /* If the child terminated normally, assume
index 78df632..002ba3f 100644 (file)
@@ -432,7 +432,7 @@ static void winbindd_sig_chld_handler(struct tevent_context *ev,
 {
        pid_t pid;
 
-       while ((pid = sys_waitpid(-1, NULL, WNOHANG)) > 0) {
+       while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
                winbind_child_died(pid);
        }
 }
index f311056..e341514 100644 (file)
 #include <errno.h>
 #include <pthread.h>
 
-static int sys_waitpid(pid_t pid,int *status,int options)
-{
-  return waitpid(pid,status,options);
-}
-
 #define DATA "conftest.fcntl"
 
 #define SEEK_SET 0