yp_main.c (12892) | yp_main.c (12997) |
---|---|
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.12 1995/12/11 22:38:19 wpaul Exp $ | 32 * $Id: yp_main.c,v 1.1.1.1 1995/12/16 20:54:17 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.12 1995/12/11 22:38:19 wpaul Exp $"; | 68static char rcsid[] = "$Id: yp_main.c,v 1.1.1.1 1995/12/16 20:54:17 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 --- 114 unchanged lines hidden (view full) --- 191 (void) signal(SIGALRM, (SIG_PF) closedown); 192 (void) alarm(_RPCSVC_CLOSEDOWN/2); 193} 194 195main(argc, argv) 196 int argc; 197 char *argv[]; 198{ | 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 --- 114 unchanged lines hidden (view full) --- 191 (void) signal(SIGALRM, (SIG_PF) closedown); 192 (void) alarm(_RPCSVC_CLOSEDOWN/2); 193} 194 195main(argc, argv) 196 int argc; 197 char *argv[]; 198{ |
199 register SVCXPRT *transp; | 199 register SVCXPRT *transp = NULL; |
200 int sock; | 200 int sock; |
201 int proto; | 201 int proto = 0; |
202 struct sockaddr_in saddr; 203 int asize = sizeof (saddr); 204 int ch; 205 206 while ((ch = getopt(argc, argv, "hdnkp:")) != EOF) { 207 switch(ch) { 208 case 'd': | 202 struct sockaddr_in saddr; 203 int asize = sizeof (saddr); 204 int ch; 205 206 while ((ch = getopt(argc, argv, "hdnkp:")) != EOF) { 207 switch(ch) { 208 case 'd': |
209 debug = 1; | 209 debug = ypdb_debug = 1; |
210 break; 211 case 'n': 212 do_dns = 1; 213 break; 214 case 'k': 215 sunos_4_kludge = 1; 216 break; 217 case 'p': --- 98 unchanged lines hidden --- | 210 break; 211 case 'n': 212 do_dns = 1; 213 break; 214 case 'k': 215 sunos_4_kludge = 1; 216 break; 217 case 'p': --- 98 unchanged lines hidden --- |