tech-userlevel archive

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

trivial puffs error branch patch



(I am not subscribed to this list, so please cc me in replies.)

I've been sitting for a while on this trivial patch to fix an error
branch in puffs that looks wrong.  I'd commit it if there were another
pair of eyeballs on it.  Anyone care to do a quick sanity check?

Index: lib/libpuffs/framebuf.c
===================================================================
RCS file: /cvsroot/src/lib/libpuffs/framebuf.c,v
retrieving revision 1.30
diff -p -u -r1.30 framebuf.c
--- lib/libpuffs/framebuf.c     12 Jan 2010 18:42:38 -0000      1.30
+++ lib/libpuffs/framebuf.c     10 Jul 2011 15:48:24 -0000
@@ -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: sbin/mount_portal/puffs_portal.c
===================================================================
RCS file: /cvsroot/src/sbin/mount_portal/puffs_portal.c,v
retrieving revision 1.3
diff -p -u -r1.3 puffs_portal.c
--- sbin/mount_portal/puffs_portal.c    19 Dec 2009 16:01:25 -0000      1.3
+++ sbin/mount_portal/puffs_portal.c    10 Jul 2011 15:48:27 -0000
@@ -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;


Home | Main Index | Thread Index | Old Index