Source-Changes-HG archive

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

[src/trunk]: src/libexec/rshd - use SHUT_RDWR instead of 1+1 for the 2nd arg ...



details:   https://anonhg.NetBSD.org/src/rev/12cfd2ae1bd3
branches:  trunk
changeset: 502043:12cfd2ae1bd3
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jan 11 01:32:34 2001 +0000

description:
- use SHUT_RDWR instead of 1+1 for the 2nd arg to shutdown()
- use LOG_ERR for fatal errors
- don't use LOG_ODELAY, it's the default

diffstat:

 libexec/rshd/rshd.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (74 lines):

diff -r 7f77080632c6 -r 12cfd2ae1bd3 libexec/rshd/rshd.c
--- a/libexec/rshd/rshd.c       Thu Jan 11 00:54:57 2001 +0000
+++ b/libexec/rshd/rshd.c       Thu Jan 11 01:32:34 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rshd.c,v 1.21 2000/11/09 01:04:14 itojun Exp $ */
+/*     $NetBSD: rshd.c,v 1.22 2001/01/11 01:32:34 lukem Exp $  */
 
 /*
  * Copyright (C) 1998 WIDE Project.
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = "@(#)rshd.c     8.2 (Berkeley) 4/6/94";
 #else
-__RCSID("$NetBSD: rshd.c,v 1.21 2000/11/09 01:04:14 itojun Exp $");
+__RCSID("$NetBSD: rshd.c,v 1.22 2001/01/11 01:32:34 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -134,7 +134,7 @@
        int ch, on = 1, fromlen;
        struct sockaddr_storage from;
 
-       openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
+       openlog("rshd", LOG_PID, LOG_DAEMON);
 
        opterr = 0;
        while ((ch = getopt(argc, argv, OPTIONS)) != -1)
@@ -326,8 +326,8 @@
 
                if ((cc = read(STDIN_FILENO, &c, 1)) != 1) {
                        if (cc < 0)
-                               syslog(LOG_NOTICE, "read: %m");
-                       shutdown(0, 1+1);
+                               syslog(LOG_ERR, "read: %m");
+                       shutdown(0, SHUT_RDWR);
                        exit(1);
                }
                if (c == 0)
@@ -349,7 +349,7 @@
                }
                *portp = htons(port);
                if (connect(s, (struct sockaddr *)fromp, fromp->sa_len) < 0) {
-                       syslog(LOG_INFO, "connect second port %d: %m", port);
+                       syslog(LOG_ERR, "connect second port %d: %m", port);
                        exit(1);
                }
        }
@@ -382,7 +382,7 @@
                        hints.ai_flags = AI_CANONNAME;
                        gaierror = getaddrinfo(remotehost, pbuf, &hints, &res0);
                        if (gaierror) {
-                               syslog(LOG_INFO,
+                               syslog(LOG_NOTICE,
                                    "Couldn't look up address for %s: %s",
                                    remotehost, gai_strerror(gaierror));
                                errorstr =
@@ -543,7 +543,7 @@
                                        errno = 0;
                                        cc = read(pv[0], buf, sizeof(buf));
                                        if (cc <= 0) {
-                                               shutdown(s, 1+1);
+                                               shutdown(s, SHUT_RDWR);
                                                FD_CLR(pv[0], &readfrom);
                                        } else {
                                                (void) write(s, buf, cc);
@@ -573,7 +573,7 @@
        
        if((sh = login_getcapstr(lc, "shell", NULL, NULL))) {
                if(!(sh = strdup(sh))) {
-                       syslog(LOG_NOTICE, "Cannot alloc mem");
+                       syslog(LOG_ERR, "Cannot alloc mem");
                        exit(1);
                }
                pwd->pw_shell = sh;



Home | Main Index | Thread Index | Old Index