Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/lpd * Use STDOUT_FILENO instead of 1.



details:   https://anonhg.NetBSD.org/src/rev/308ab4654956
branches:  trunk
changeset: 538695:308ab4654956
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Oct 26 01:46:31 2002 +0000

description:
* Use STDOUT_FILENO instead of 1.
* Pass the file descriptor to request_init() (libwrap) so that
  it can actually do something useful later in fromhost().

diffstat:

 usr.sbin/lpr/lpd/lpd.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r a20a08f6de80 -r 308ab4654956 usr.sbin/lpr/lpd/lpd.c
--- a/usr.sbin/lpr/lpd/lpd.c    Fri Oct 25 22:53:57 2002 +0000
+++ b/usr.sbin/lpr/lpd/lpd.c    Sat Oct 26 01:46:31 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lpd.c,v 1.43 2002/09/24 13:31:33 itojun Exp $  */
+/*     $NetBSD: lpd.c,v 1.44 2002/10/26 01:46:31 thorpej Exp $ */
 
 /*
  * Copyright (c) 1983, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = "@(#)lpd.c      8.7 (Berkeley) 5/10/95";
 #else
-__RCSID("$NetBSD: lpd.c,v 1.43 2002/09/24 13:31:33 itojun Exp $");
+__RCSID("$NetBSD: lpd.c,v 1.44 2002/10/26 01:46:31 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -345,7 +345,7 @@
                        signal(SIGTERM, SIG_IGN);
                                for (i = 0; i < nfds; i++) 
                                (void)close(socks[i].fd);
-                       dup2(s, 1);
+                       dup2(s, STDOUT_FILENO);
                        (void)close(s);
                        if (from.ss_family != AF_LOCAL) {
                                /* for both AF_INET and AF_INET6 */
@@ -658,7 +658,8 @@
        setproctitle("serving %s", from);
 
 #ifdef LIBWRAP
-       request_init(&req, RQ_DAEMON, "lpd", RQ_CLIENT_SIN, f, NULL);
+       request_init(&req, RQ_DAEMON, "lpd", RQ_CLIENT_SIN, f,
+           RQ_FILE, STDOUT_FILENO, NULL);
        fromhost(&req);
        if (!hosts_access(&req))
                goto denied;



Home | Main Index | Thread Index | Old Index