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 Ensure s is initialized before testing (no...



details:   https://anonhg.NetBSD.org/src/rev/7754a999c05d
branches:  trunk
changeset: 581503:7754a999c05d
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jun 02 05:57:03 2005 +0000

description:
Ensure s is initialized before testing  (none of the sockets may be ready
so it might not be setup).
Detected with gcc -Wuninitialized.

diffstat:

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

diffs (26 lines):

diff -r 9708c618daa5 -r 7754a999c05d usr.sbin/lpr/lpd/lpd.c
--- a/usr.sbin/lpr/lpd/lpd.c    Thu Jun 02 05:54:44 2005 +0000
+++ b/usr.sbin/lpr/lpd/lpd.c    Thu Jun 02 05:57:03 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lpd.c,v 1.50 2004/10/30 08:44:26 dsl Exp $     */
+/*     $NetBSD: lpd.c,v 1.51 2005/06/02 05:57:03 lukem Exp $   */
 
 /*
  * Copyright (c) 1983, 1993, 1994
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)lpd.c      8.7 (Berkeley) 5/10/95";
 #else
-__RCSID("$NetBSD: lpd.c,v 1.50 2004/10/30 08:44:26 dsl Exp $");
+__RCSID("$NetBSD: lpd.c,v 1.51 2005/06/02 05:57:03 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -319,6 +319,7 @@
                                syslog(LOG_WARNING, "poll: %m");
                        continue;
                }
+               s = -1;
                 for (i = 0; i < nfds; i++) 
                        if (socks[i].revents & POLLIN) {
                                fromlen = sizeof(from);



Home | Main Index | Thread Index | Old Index