Deleted Added
full compact
inetd.c (48988) inetd.c (48989)
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. 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

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
43#endif
44static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. 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

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
43#endif
44static const char rcsid[] =
45 "$Id: inetd.c,v 1.65 1999/07/22 14:47:29 sheldonh Exp $";
45 "$Id: inetd.c,v 1.66 1999/07/22 15:57:37 sheldonh Exp $";
46#endif /* not lint */
47
48/*
49 * Inetd - Internet super-server
50 *
51 * This program invokes all internet services as needed. Connection-oriented
52 * services are invoked each time a connection is made, by creating a process.
53 * This process is passed the connection as file descriptor 0 and is expected

--- 92 unchanged lines hidden (view full) ---

146#ifndef LIBWRAP_DENY_SEVERITY
147# define LIBWRAP_DENY_SEVERITY LOG_WARNING
148#endif
149
150#define ISWRAP(sep) \
151 ( ((wrap_ex && !(sep)->se_bi) || (wrap_bi && (sep)->se_bi)) \
152 && ( ((sep)->se_accept && (sep)->se_socktype == SOCK_STREAM) \
153 || (sep)->se_socktype == SOCK_DGRAM))
46#endif /* not lint */
47
48/*
49 * Inetd - Internet super-server
50 *
51 * This program invokes all internet services as needed. Connection-oriented
52 * services are invoked each time a connection is made, by creating a process.
53 * This process is passed the connection as file descriptor 0 and is expected

--- 92 unchanged lines hidden (view full) ---

146#ifndef LIBWRAP_DENY_SEVERITY
147# define LIBWRAP_DENY_SEVERITY LOG_WARNING
148#endif
149
150#define ISWRAP(sep) \
151 ( ((wrap_ex && !(sep)->se_bi) || (wrap_bi && (sep)->se_bi)) \
152 && ( ((sep)->se_accept && (sep)->se_socktype == SOCK_STREAM) \
153 || (sep)->se_socktype == SOCK_DGRAM))
154#define LARGEST(x,y) ((x) > (y) ? (x) : (y))
155
156#ifdef LOGIN_CAP
157#include <login_cap.h>
158
159/* see init.c */
160#define RESOURCE_RC "daemon"
161
162#endif

--- 199 unchanged lines hidden (view full) ---

362 }
363
364 if (pipe(signalpipe) != 0) {
365 syslog(LOG_ERR, "pipe: %%m");
366 exit(EX_OSERR);
367 }
368 FD_SET(signalpipe[0], &allsock);
369 nsock++;
154
155#ifdef LOGIN_CAP
156#include <login_cap.h>
157
158/* see init.c */
159#define RESOURCE_RC "daemon"
160
161#endif

--- 199 unchanged lines hidden (view full) ---

361 }
362
363 if (pipe(signalpipe) != 0) {
364 syslog(LOG_ERR, "pipe: %%m");
365 exit(EX_OSERR);
366 }
367 FD_SET(signalpipe[0], &allsock);
368 nsock++;
370 if (signalpipe[0] > maxsock || signalpipe[1] > maxsock)
371 maxsock = LARGEST(signalpipe[0], signalpipe[1]);
369 if (signalpipe[0] > maxsock)
370 maxsock = signalpipe[0];
371 if (signalpipe[1] > maxsock)
372 maxsock = signalpipe[1];
372
373 for (;;) {
374 int n, ctrl;
375 fd_set readable;
376
377 if (nsock == 0) {
378 syslog(LOG_ERR, "%s: nsock=0", __FUNCTION__);
379 exit(EX_SOFTWARE);

--- 1282 unchanged lines hidden ---
373
374 for (;;) {
375 int n, ctrl;
376 fd_set readable;
377
378 if (nsock == 0) {
379 syslog(LOG_ERR, "%s: nsock=0", __FUNCTION__);
380 exit(EX_SOFTWARE);

--- 1282 unchanged lines hidden ---