yp_main.c (12997) | yp_main.c (14240) |
---|---|
1/* 2 * Copyright (c) 1995 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 * | 1/* 2 * Copyright (c) 1995 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 * $Id: yp_main.c,v 1.1.1.1 1995/12/16 20:54:17 wpaul Exp $ | 32 * $Id: yp_main.c,v 1.2 1995/12/23 21:35:32 wpaul Exp $ |
33 */ 34 35/* 36 * ypserv startup function. 37 * We need out own main() since we have to do some additional work 38 * that rpcgen won't do for us. Most of this file was generated using 39 * rpcgen.new, and later modified. 40 */ --- 19 unchanged lines hidden (view full) --- 60#include <errno.h> 61 62#ifndef SIG_PF 63#define SIG_PF void(*)(int) 64#endif 65 66#define _RPCSVC_CLOSEDOWN 120 67#ifndef lint | 33 */ 34 35/* 36 * ypserv startup function. 37 * We need out own main() since we have to do some additional work 38 * that rpcgen won't do for us. Most of this file was generated using 39 * rpcgen.new, and later modified. 40 */ --- 19 unchanged lines hidden (view full) --- 60#include <errno.h> 61 62#ifndef SIG_PF 63#define SIG_PF void(*)(int) 64#endif 65 66#define _RPCSVC_CLOSEDOWN 120 67#ifndef lint |
68static char rcsid[] = "$Id: yp_main.c,v 1.1.1.1 1995/12/16 20:54:17 wpaul Exp $"; | 68static char rcsid[] = "$Id: yp_main.c,v 1.2 1995/12/23 21:35:32 wpaul Exp $"; |
69#endif /* not lint */ 70int _rpcpmstart; /* Started by a port monitor ? */ 71static int _rpcfdtype; 72 /* Whether Stream or Datagram ? */ 73 /* States a server can be in wrt request */ 74 75#define _IDLE 0 76#define _SERVED 1 --- 65 unchanged lines hidden (view full) --- 142 (void) pmap_unset(YPPROG, 1); 143} 144 145static void reaper(sig) 146 int sig; 147{ 148 int status; 149 | 69#endif /* not lint */ 70int _rpcpmstart; /* Started by a port monitor ? */ 71static int _rpcfdtype; 72 /* Whether Stream or Datagram ? */ 73 /* States a server can be in wrt request */ 74 75#define _IDLE 0 76#define _SERVED 1 --- 65 unchanged lines hidden (view full) --- 142 (void) pmap_unset(YPPROG, 1); 143} 144 145static void reaper(sig) 146 int sig; 147{ 148 int status; 149 |
150 if (sig == SIGHUP) { 151 load_securenets(); 152 return; 153 } 154 |
|
150 if (sig == SIGCHLD) { 151 while (wait3(&status, WNOHANG, NULL) > 0) 152 children--; 153 } else { 154 unregister(); 155 exit(0); 156 } 157} --- 60 unchanged lines hidden (view full) --- 218 yp_dir = optarg; 219 break; 220 case 'h': 221 default: 222 usage(); 223 } 224 } 225 | 155 if (sig == SIGCHLD) { 156 while (wait3(&status, WNOHANG, NULL) > 0) 157 children--; 158 } else { 159 unregister(); 160 exit(0); 161 } 162} --- 60 unchanged lines hidden (view full) --- 223 yp_dir = optarg; 224 break; 225 case 'h': 226 default: 227 usage(); 228 } 229 } 230 |
231 load_securenets(); 232 |
|
226 if (getsockname(0, (struct sockaddr *)&saddr, &asize) == 0) { 227 int ssize = sizeof (int); 228 229 if (saddr.sin_family != AF_INET) 230 exit(1); 231 if (getsockopt(0, SOL_SOCKET, SO_TYPE, 232 (char *)&_rpcfdtype, &ssize) == -1) 233 exit(1); --- 82 unchanged lines hidden --- | 233 if (getsockname(0, (struct sockaddr *)&saddr, &asize) == 0) { 234 int ssize = sizeof (int); 235 236 if (saddr.sin_family != AF_INET) 237 exit(1); 238 if (getsockopt(0, SOL_SOCKET, SO_TYPE, 239 (char *)&_rpcfdtype, &ssize) == -1) 240 exit(1); --- 82 unchanged lines hidden --- |