statd.c (50479) | statd.c (51794) |
---|---|
1/* 2 * Copyright (c) 1995 3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 */ 33 34#ifndef lint 35static const char rcsid[] = | 1/* 2 * Copyright (c) 1995 3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 */ 33 34#ifndef lint 35static const char rcsid[] = |
36 "$FreeBSD: head/usr.sbin/rpc.statd/statd.c 50479 1999-08-28 01:35:59Z peter $"; | 36 "$FreeBSD: head/usr.sbin/rpc.statd/statd.c 51794 1999-09-29 15:18:46Z marcel $"; |
37#endif /* not lint */ 38 39/* main() function for status monitor daemon. Some of the code in this */ 40/* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */ 41/* The actual program logic is in the file procs.c */ 42 43#include <err.h> 44#include <stdio.h> --- 75 unchanged lines hidden (view full) --- 120 Retruns: Nothing. 121 Notes: No special action required, other than to collect the 122 process status and hence allow the child to die: 123 we only use child processes for asynchronous transmission 124 of SM_NOTIFY to other systems, so it is normal for the 125 children to exit when they have done their work. 126*/ 127 | 37#endif /* not lint */ 38 39/* main() function for status monitor daemon. Some of the code in this */ 40/* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */ 41/* The actual program logic is in the file procs.c */ 42 43#include <err.h> 44#include <stdio.h> --- 75 unchanged lines hidden (view full) --- 120 Retruns: Nothing. 121 Notes: No special action required, other than to collect the 122 process status and hence allow the child to die: 123 we only use child processes for asynchronous transmission 124 of SM_NOTIFY to other systems, so it is normal for the 125 children to exit when they have done their work. 126*/ 127 |
128static void handle_sigchld(int sig, int code, struct sigcontext *scp) | 128static void handle_sigchld(int sig, int code, void *scp) |
129{ 130 int pid, status; 131 pid = wait4(-1, &status, WNOHANG, (struct rusage*)0); 132 if (!pid) syslog(LOG_ERR, "Phantom SIGCHLD??"); 133 else if (status == 0) 134 { 135 if (debug) syslog(LOG_DEBUG, "Child %d exited OK", pid); 136 } 137 else syslog(LOG_ERR, "Child %d failed with status %d", pid, 138 WEXITSTATUS(status)); 139} 140 | 129{ 130 int pid, status; 131 pid = wait4(-1, &status, WNOHANG, (struct rusage*)0); 132 if (!pid) syslog(LOG_ERR, "Phantom SIGCHLD??"); 133 else if (status == 0) 134 { 135 if (debug) syslog(LOG_DEBUG, "Child %d exited OK", pid); 136 } 137 else syslog(LOG_ERR, "Child %d failed with status %d", pid, 138 WEXITSTATUS(status)); 139} 140 |