kq attach functions should return an errno so 1 is wrong

spotted while looking at kq/pipe problem, there are lots of others in
the tree but that's for later

ok?


Index: sys_pipe.c
===================================================================
RCS file: /cvs/src/sys/kern/sys_pipe.c,v
retrieving revision 1.58
diff -u -p -r1.58 sys_pipe.c
--- sys_pipe.c  14 Jan 2010 23:12:11 -0000      1.58
+++ sys_pipe.c  26 May 2011 09:12:18 -0000
@@ -773,16 +773,17 @@ pipe_kqfilter(struct file *fp, struct kn
                SLIST_INSERT_HEAD(&rpipe->pipe_sel.si_note, kn, kn_selnext);
                break;
        case EVFILT_WRITE:
-               if (wpipe == NULL)
+               if (wpipe == NULL) {
                        /* other end of pipe has been closed */
-                       return (1);
+                       return (EPIPE);
+               }
                kn->kn_fop = &pipe_wfiltops;
                SLIST_INSERT_HEAD(&wpipe->pipe_sel.si_note, kn, kn_selnext);
                break;
        default:
-               return (1);
+               return (EINVAL);
        }
-       
+
        return (0);
 }

Reply via email to