Skip to contentSkip to conversation

LVM2/tools lvmcmdline.c

PATCH [email protected] 1 participant 1 message Feb 13, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-02-13 12:07:51

Modified files:
tools : lvmcmdline.c

Log message:
Handle all succefull values from open()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150

tools/lvmcmdline.c +1 -1
@@ -1149,7 +1149,7 @@
 
 	snprintf(buf, sizeof(buf), DEFAULT_PROC_DIR "/%u/cmdline", pid);
 	/* FIXME Use generic read code. */
-	if ((fd = open(buf, O_RDONLY)) > 0) {
+	if ((fd = open(buf, O_RDONLY)) >= 0) {
 		if ((n = read(fd, _proc_cmdline, sizeof(_proc_cmdline) - 1)) < 0) {
 			log_sys_error("read", buf);
 			n = 0;