Module Name:    src
Committed By:   wiz
Date:           Sun Jan 17 22:48:50 UTC 2010

Modified Files:
        src/distrib/utils/sysinst: wskbd.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/sysinst/wskbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/wskbd.c
diff -u src/distrib/utils/sysinst/wskbd.c:1.8 src/distrib/utils/sysinst/wskbd.c:1.9
--- src/distrib/utils/sysinst/wskbd.c:1.8	Sat Jan  2 18:06:57 2010
+++ src/distrib/utils/sysinst/wskbd.c	Sun Jan 17 22:48:50 2010
@@ -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);

Reply via email to