1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib: Remove sys_waitpid

We have waitpid in libreplace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Volker Lendecke 2016-02-16 15:46:06 +01:00 committed by Michael Adam
parent b7b7b0a819
commit 8338fe6ac8
11 changed files with 10 additions and 29 deletions

View 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);

View 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) {

View 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;

View 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);

View 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"));

View 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)));

View 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);

View 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;

View 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

View 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);
}
}

View File

@ -15,11 +15,6 @@
#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