Module Name:    src
Committed By:   riastradh
Date:           Mon Dec 19 15:36:27 UTC 2011

Modified Files:
        src/lib/libpuffs: framebuf.c
        src/sbin/mount_portal: puffs_portal.c

Log Message:
Fix error reporting in puffs_framev_enqueue_waitevent and callers.

ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libpuffs/framebuf.c
cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_portal/puffs_portal.c

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

Modified files:

Index: src/lib/libpuffs/framebuf.c
diff -u src/lib/libpuffs/framebuf.c:1.30 src/lib/libpuffs/framebuf.c:1.31
--- src/lib/libpuffs/framebuf.c:1.30	Tue Jan 12 18:42:38 2010
+++ src/lib/libpuffs/framebuf.c	Mon Dec 19 15:36:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: framebuf.c,v 1.30 2010/01/12 18:42:38 pooka Exp $	*/
+/*	$NetBSD: framebuf.c,v 1.31 2011/12/19 15:36:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: framebuf.c,v 1.30 2010/01/12 18:42:38 pooka Exp $");
+__RCSID("$NetBSD: framebuf.c,v 1.31 2011/12/19 15:36:26 riastradh Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -561,9 +561,8 @@ puffs_framev_enqueue_waitevent(struct pu
 			EV_SET(&kev, fd, EVFILT_READ, EV_ENABLE,
 			    0, 0, (uintptr_t)fio);
 
-	rv = kevent(pu->pu_kq, &kev, 1, NULL, 0, NULL);
-	if (rv != 0)
-		return errno;
+	if (kevent(pu->pu_kq, &kev, 1, NULL, 0, NULL) == -1)
+		return -1;
 
 	if (*what & PUFFS_FBIO_READ)
 		fio->rwait++;

Index: src/sbin/mount_portal/puffs_portal.c
diff -u src/sbin/mount_portal/puffs_portal.c:1.4 src/sbin/mount_portal/puffs_portal.c:1.5
--- src/sbin/mount_portal/puffs_portal.c:1.4	Mon Aug 29 14:35:02 2011
+++ src/sbin/mount_portal/puffs_portal.c	Mon Dec 19 15:36:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_portal.c,v 1.4 2011/08/29 14:35:02 joerg Exp $	*/
+/*	$NetBSD: puffs_portal.c,v 1.5 2011/12/19 15:36:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: puffs_portal.c,v 1.4 2011/08/29 14:35:02 joerg Exp $");
+__RCSID("$NetBSD: puffs_portal.c,v 1.5 2011/12/19 15:36:27 riastradh Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -729,7 +729,6 @@ portal_node_poll(struct puffs_usermount 
 	struct puffs_cc *pcc = puffs_cc_getcc(pu);
 	struct portal_node *portn = opc;
 	int what;
-	int rv;
 
 	what = 0;
 	if (*events & POLLIN)
@@ -739,10 +738,9 @@ portal_node_poll(struct puffs_usermount 
 	if (*events & POLLERR)
 		what |= PUFFS_FBIO_ERROR;
 
-	rv = puffs_framev_enqueue_waitevent(pcc, portn->fd, &what);
-	if (rv) {
+	if (puffs_framev_enqueue_waitevent(pcc, portn->fd, &what) == -1) {
 		*events = POLLERR;
-		return rv;
+		return errno;
 	}
 
 	*events = 0;

Reply via email to