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 09e991507fcb3f6617e6dd35326ae391b73e56ce..aaa5aee295886f20a6ac7034f26e0c0c319a7c5b 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 c725607e9578f4ce0800b59c7050c82ec41c66ca..1d64db2af0c66467845a90736be2591c45f62322 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 55f7a871d3ac267eaeabe05a460cf35fbfdc6790..63b0323c51c46c2b95980d53fb1f377dff4eb0a3 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 0351e376265f386482ac0492bb94dd61c516e065..acc121de14d2a28d9f3cce7a5246db72e912daae 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 2592402afd8b7b3e13eaabe41f661c2733c99f6c..9db182fb0b3ceb4377bd6f43cddb390183befb67 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 6e31ee4c21a928ded8edbb9336f91386cea19737..c9e55223b137526e2f9439a6b3ff8e770101177d 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 51d10b63e05626701092d108f8d2249f2d0cfd8a..48a914ef6de40280f2ff3b0c1953acbc4d0a8a7b 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 bfb7af6051b1034e102315778bf29f8ec2c175de..ad4eaa72a019ab4a351e8a4c3bb211453ffa6446 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 42fcad6de1bea9fa4a027a8bd4f9f73479f26d26..d68615e864e55fb7ea91de2a1cfc96fca3691db5 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 78df632f49800983cb308f09f664c5a4302b22fb..002ba3f5e8c616ee02a0adae190bcac610b4a0b9 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 f31105626c2521035269b731eab63e7233fd416f..e3415146a7f8deb827c0453232a51ef812e0cdde 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