diff options
author | millert <millert@openbsd.org> | 2014-12-16 03:35:49 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 2014-12-16 03:35:49 +0000 |
commit | 2fc3edb7a766da12a52bf60b84fbc19b679f6765 (patch) | |
tree | 9f819421e609b61f2f7c528e7390761b54183175 /usr.sbin/lpr | |
parent | Remove some useless casts and includes. OK deraadt@ tedu@ (diff) | |
download | wireguard-openbsd-2fc3edb7a766da12a52bf60b84fbc19b679f6765.tar.xz wireguard-openbsd-2fc3edb7a766da12a52bf60b84fbc19b679f6765.zip |
Replace setpgrp(0, getpid()) with setpgid(0, 0). OK deraadt@ tedu@
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 2bafc0ca2f9..226f299b458 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printjob.c,v 1.52 2014/02/07 23:06:21 millert Exp $ */ +/* $OpenBSD: printjob.c,v 1.53 2014/12/16 03:35:49 millert Exp $ */ /* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */ /* @@ -152,8 +152,7 @@ printjob(void) } (void)close(fd); } - pid = getpid(); /* for use with lprm */ - setpgrp(0, pid); + setpgid(0, 0); /* we add SIGINT to the mask so abortpr() doesn't kill itself */ memset(&sa, 0, sizeof(sa)); @@ -187,6 +186,7 @@ printjob(void) /* * write process id for others to know */ + pid = getpid(); if ((pidoff = i = snprintf(line, sizeof(line), "%d\n", pid)) >= sizeof(line) || pidoff == -1) { syslog(LOG_ERR, "impossibly large pid: %u", pid); |