Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Only a return value below 0 denotes an...



details:   https://anonhg.NetBSD.org/src/rev/d97a42ddf408
branches:  trunk
changeset: 750874:d97a42ddf408
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Jan 17 22:48:50 2010 +0000

description:
Only a return value below 0 denotes an error in open(2). Found by cppcheck.

diffstat:

 distrib/utils/sysinst/wskbd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 3712700ebc1e -r d97a42ddf408 distrib/utils/sysinst/wskbd.c
--- a/distrib/utils/sysinst/wskbd.c     Sun Jan 17 22:47:18 2010 +0000
+++ b/distrib/utils/sysinst/wskbd.c     Sun Jan 17 22:48:50 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $    */
+/*     $NetBSD: wskbd.c,v 1.9 2010/01/17 22:48:50 wiz Exp $    */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $");
+__RCSID("$NetBSD: wskbd.c,v 1.9 2010/01/17 22:48:50 wiz Exp $");
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -96,7 +96,7 @@
        const char *dflt = msg_string(MSG_kb_default);
 
        fd = open("/dev/wskbd0", O_WRONLY);
-       if (fd <= 0)
+       if (fd < 0)
                return;
        if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) >=  0) {
                memset(&opt, 0, sizeof opt);



Home | Main Index | Thread Index | Old Index