summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d5a82c6)
SCCS-vsn: usr.sbin/timed/timed/Makefile 5.11
SCCS-vsn: usr.sbin/timed/timed/timed.c 2.20
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.30
SCCS-vsn: usr.sbin/rwhod/rwhod.c 5.19
SCCS-vsn: usr.sbin/lpr/lpd/Makefile 5.3
SCCS-vsn: usr.sbin/lpr/lpd/lpd.c 5.9
-# @(#)Makefile 5.2 (Berkeley) %G%
+# @(#)Makefile 5.3 (Berkeley) %G%
PROG= lpd
CFLAGS+=-I${.CURDIR}/../common_source
PROG= lpd
CFLAGS+=-I${.CURDIR}/../common_source
MAN8= lpd.0
SRCS= lpd.c printjob.c recvjob.c displayq.c rmjob.c startdaemon.c \
lpdchar.c common.c printcap.c
MAN8= lpd.0
SRCS= lpd.c printjob.c recvjob.c displayq.c rmjob.c startdaemon.c \
lpdchar.c common.c printcap.c
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)lpd.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)lpd.c 5.9 (Berkeley) %G%";
/*
* Set up standard environment by detaching from the parent.
*/
/*
* Set up standard environment by detaching from the parent.
*/
- if (fork())
- exit(0);
- for (f = 0; f < 5; f++)
- (void) close(f);
- (void) open(_PATH_DEVNULL, O_RDONLY);
- (void) open(_PATH_DEVNULL, O_WRONLY);
- (void) dup(1);
- f = open(_PATH_TTY, O_RDWR);
- if (f > 0) {
- ioctl(f, TIOCNOTTY, 0);
- (void) close(f);
- }
#endif
openlog("lpd", LOG_PID, LOG_LPR);
#endif
openlog("lpd", LOG_PID, LOG_LPR);
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)rwhod.c 5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)rwhod.c 5.19 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
- if (fork())
- exit(0);
- { int s;
- for (s = 0; s < 10; s++)
- (void) close(s);
- (void) open("/", 0);
- (void) dup2(0, 1);
- (void) dup2(0, 2);
- s = open(_PATH_TTY, 2);
- if (s >= 0) {
- ioctl(s, TIOCNOTTY, 0);
- (void) close(s);
- }
- }
#endif
if (chdir(_PATH_RWHODIR) < 0) {
(void)fprintf(stderr, "rwhod: %s: %s\n",
#endif
if (chdir(_PATH_RWHODIR) < 0) {
(void)fprintf(stderr, "rwhod: %s: %s\n",
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.30 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
#include <sys/file.h>
#include <signal.h>
#include <sgtty.h>
#include <sys/file.h>
#include <signal.h>
#include <sgtty.h>
while ((fd = dup(fileno(CurEnv->e_xfp))) < 2 && fd > 0)
continue;
while ((fd = dup(fileno(CurEnv->e_xfp))) < 2 && fd > 0)
continue;
/* drop our controlling TTY completely if possible */
if (fulldrop)
{
/* drop our controlling TTY completely if possible */
if (fulldrop)
{
+#if BSD > 43
+ daemon(1, 1);
+#else
+#ifdef TIOCNOTTY
fd = open("/dev/tty", 2);
if (fd >= 0)
{
fd = open("/dev/tty", 2);
if (fd >= 0)
{
(void) close(fd);
}
(void) setpgrp(0, 0);
(void) close(fd);
}
(void) setpgrp(0, 0);
+#endif /* TIOCNOTTY */
+#endif /* BSD */
# ifdef LOG
if (LogLevel > 11)
# ifdef LOG
if (LogLevel > 11)
-# @(#)Makefile 5.10 (Berkeley) %G%
+# @(#)Makefile 5.11 (Berkeley) %G%
#
# optional flags are: MEASURE TESTING DEBUG
#
# optional flags are: MEASURE TESTING DEBUG
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)timed.c 2.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)timed.c 2.20 (Berkeley) %G%";
#endif /* not lint */
#include "globals.h"
#endif /* not lint */
#include "globals.h"