summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv/yp_main.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1996-05-31 16:01:51 +0000
committerwpaul <wpaul@FreeBSD.org>1996-05-31 16:01:51 +0000
commit7db7b1cde125e2f1b07ce515a44386287ffe20e3 (patch)
tree09d1229ceb91ce3fd14b2705728d76c9b2ed0f9f /usr.sbin/ypserv/yp_main.c
parentd4c70b6e6444ede1b94fe2e860bc791d28cd0604 (diff)
downloadFreeBSD-src-7db7b1cde125e2f1b07ce515a44386287ffe20e3.zip
FreeBSD-src-7db7b1cde125e2f1b07ce515a44386287ffe20e3.tar.gz
Small touch-ups -- no functional changes.
Fix some comments to reflect reality (in some cases I made changes to code but not to the comments). Change some instances of 'inline' to '__inline' to pacify gcc -ansi -pedantic. Use rcsid strings more consistently. Make 'oldaddr' static in yp_access(). Use strcpy()/strcat() in yp_open_db_cache() instead of snprintf(). (Seems to be a little faster this way.)
Diffstat (limited to 'usr.sbin/ypserv/yp_main.c')
-rw-r--r--usr.sbin/ypserv/yp_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c
index c4f9275..4d57d19 100644
--- a/usr.sbin/ypserv/yp_main.c
+++ b/usr.sbin/ypserv/yp_main.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: yp_main.c,v 1.2 1996/04/21 21:33:40 wpaul Exp $
+ * $Id: yp_main.c,v 1.3 1996/05/01 02:39:34 wpaul Exp wpaul $
*/
/*
@@ -58,6 +58,7 @@
#include <unistd.h>
#include <rpc/rpc.h>
#include <errno.h>
+#include <err.h>
#ifndef SIG_PF
#define SIG_PF void(*)(int)
@@ -65,7 +66,7 @@
#define _RPCSVC_CLOSEDOWN 120
#ifndef lint
-static char rcsid[] = "$Id: yp_main.c,v 1.2 1996/04/21 21:33:40 wpaul Exp $";
+static const char rcsid[] = "$Id: yp_main.c,v 1.3 1996/05/01 02:39:34 wpaul Exp wpaul $";
#endif /* not lint */
int _rpcpmstart; /* Started by a port monitor ? */
static int _rpcfdtype;
@@ -107,6 +108,7 @@ yp_svc_run()
#endif /* def FD_SETSIZE */
extern int forked;
int pid;
+ int fd_setsize = _rpc_dtablesize();
/* Establish the identity of the parent ypserv process. */
pid = getpid();
@@ -117,7 +119,7 @@ yp_svc_run()
#else
readfds = svc_fds;
#endif /* def FD_SETSIZE */
- switch (select(_rpc_dtablesize(), &readfds, NULL, NULL,
+ switch (select(fd_setsize, &readfds, NULL, NULL,
(struct timeval *)0)) {
case -1:
if (errno == EINTR) {
@@ -246,8 +248,7 @@ main(argc, argv)
} else {
if (!debug) {
if (daemon(0,0)) {
- perror("cannot fork");
- exit(1);
+ err(1,"cannot fork");
}
openlog(progname, LOG_PID, LOG_DAEMON);
}
OpenPOWER on IntegriCloud