main.c (6752) | main.c (8857) |
---|---|
1/* 2 | 1/* 2 |
3This code is not copyright, and is placed in the public domain. Feel free to | 3This code is not copyright, and is placed in the public domain. Feel free to |
4use and modify. Please send modifications and/or suggestions + bug fixes to 5 6 Klas Heggemann <klas@nada.kth.se> 7 8 | 4use and modify. Please send modifications and/or suggestions + bug fixes to 5 6 Klas Heggemann <klas@nada.kth.se> 7 8 |
9 $Id$ | 9 $Id: main.c,v 1.1.1.1 1995/02/26 23:40:52 wpaul Exp $ |
10 11*/ 12 13#include <syslog.h> 14#include <stdio.h> 15#include <sys/ioctl.h> 16#include <rpc/rpc.h> 17#include "bootparam_prot.h" --- 50 unchanged lines hidden (view full) --- 68 exit(1); 69 } 70 } 71 case 'f': 72 bootpfile = optarg; 73 break; 74 case 's': 75 dolog = 1; | 10 11*/ 12 13#include <syslog.h> 14#include <stdio.h> 15#include <sys/ioctl.h> 16#include <rpc/rpc.h> 17#include "bootparam_prot.h" --- 50 unchanged lines hidden (view full) --- 68 exit(1); 69 } 70 } 71 case 'f': 72 bootpfile = optarg; 73 break; 74 case 's': 75 dolog = 1; |
76#ifndef LOG_DAEMON | 76#ifndef LOG_DAEMON |
77 openlog(progname, 0 , 0); 78#else 79 openlog(progname, 0 , LOG_DAEMON); 80 setlogmask(LOG_UPTO(LOG_NOTICE)); 81#endif 82 break; 83 default: | 77 openlog(progname, 0 , 0); 78#else 79 openlog(progname, 0 , LOG_DAEMON); 80 setlogmask(LOG_UPTO(LOG_NOTICE)); 81#endif 82 break; 83 default: |
84 fprintf(stderr, | 84 fprintf(stderr, |
85 "Usage: %s [-d ] [ -s ] [ -r router ] [ -f bootparmsfile ]\n"); 86 exit(1); 87 } 88 89 if ( stat(bootpfile, &buf ) ) { 90 fprintf(stderr,"%s: ", progname); 91 perror(bootpfile); 92 exit(1); --- 19 unchanged lines hidden (view full) --- 112 dup2(0, 1); 113 dup2(0, 2); 114 s = open("/dev/tty",2); 115 if ( s >= 0 ) { 116 ioctl(s, TIOCNOTTY, 0); 117 close(s); 118 } 119 } | 85 "Usage: %s [-d ] [ -s ] [ -r router ] [ -f bootparmsfile ]\n"); 86 exit(1); 87 } 88 89 if ( stat(bootpfile, &buf ) ) { 90 fprintf(stderr,"%s: ", progname); 91 perror(bootpfile); 92 exit(1); --- 19 unchanged lines hidden (view full) --- 112 dup2(0, 1); 113 dup2(0, 2); 114 s = open("/dev/tty",2); 115 if ( s >= 0 ) { 116 ioctl(s, TIOCNOTTY, 0); 117 close(s); 118 } 119 } |
120 | |
121 | 120 |
121 |
|
122 (void)pmap_unset(BOOTPARAMPROG, BOOTPARAMVERS); 123 124 transp = svcudp_create(RPC_ANYSOCK); 125 if (transp == NULL) { 126 (void)fprintf(stderr, "cannot create udp service.\n"); 127 exit(1); 128 } 129 if (!svc_register(transp, BOOTPARAMPROG, BOOTPARAMVERS, bootparamprog_1, IPPROTO_UDP)) { 130 (void)fprintf(stderr, "unable to register (BOOTPARAMPROG, BOOTPARAMVERS, udp).\n"); 131 exit(1); 132 } 133 134 svc_run(); 135 (void)fprintf(stderr, "svc_run returned\n"); 136 exit(1); 137} 138 139 | 122 (void)pmap_unset(BOOTPARAMPROG, BOOTPARAMVERS); 123 124 transp = svcudp_create(RPC_ANYSOCK); 125 if (transp == NULL) { 126 (void)fprintf(stderr, "cannot create udp service.\n"); 127 exit(1); 128 } 129 if (!svc_register(transp, BOOTPARAMPROG, BOOTPARAMVERS, bootparamprog_1, IPPROTO_UDP)) { 130 (void)fprintf(stderr, "unable to register (BOOTPARAMPROG, BOOTPARAMVERS, udp).\n"); 131 exit(1); 132 } 133 134 svc_run(); 135 (void)fprintf(stderr, "svc_run returned\n"); 136 exit(1); 137} 138 139 |