]> Zhao Yanbai Git Server - minix.git/commitdiff
Fixed some select bugs related to pipes. Removed SELFD_* because they were
authorPhilip Homburg <philip@cs.vu.nl>
Wed, 7 Jun 2006 14:41:47 +0000 (14:41 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Wed, 7 Jun 2006 14:41:47 +0000 (14:41 +0000)
bogus and unused.

servers/fs/pipe.c
servers/fs/proto.h
servers/fs/select.c

index 25b8e51d2becbca3c947aa458bc97e37538e21b4..a6b68075d9d264e734c6f98d98bccbbea7fac3af 100644 (file)
@@ -406,15 +406,14 @@ PUBLIC int select_request_pipe(struct filp *f, int *ops, int block)
        orig_ops = *ops;
        if ((*ops & (SEL_RD|SEL_ERR))) {
                if ((err = pipe_check(f->filp_ino, READING, 0,
-                       1, f->filp_pos, &canwrite, 1)) != SUSPEND && err > 0)
+                       1, f->filp_pos, &canwrite, 1)) != SUSPEND)
                        r |= SEL_RD;
                if (err < 0 && err != SUSPEND)
                        r |= SEL_ERR;
        }
        if ((*ops & (SEL_WR|SEL_ERR))) {
                if ((err = pipe_check(f->filp_ino, WRITING, 0,
-                       1, f->filp_pos, &canwrite, 1)) != SUSPEND &&
-                       err > 0 && canwrite > 0)
+                       1, f->filp_pos, &canwrite, 1)) != SUSPEND)
                        r |= SEL_WR;
                if (err < 0 && err != SUSPEND)
                        r |= SEL_ERR;
index 5a612f6beeb3c470cfa2f995196e00d9a00b63a3..e09412b73f82b82e0b78db6296bf95493bf34b0c 100644 (file)
@@ -144,7 +144,7 @@ _PROTOTYPE( int do_pipe, (void)                                             );
 _PROTOTYPE( int do_unpause, (void)                                     );
 _PROTOTYPE( int unpause, (int proc_nr_e)                               );
 _PROTOTYPE( int pipe_check, (struct inode *rip, int rw_flag,
-                       int oflags, int bytes, off_t position, int *canwrite, int notouch));
+       int oflags, int bytes, off_t position, int *canwrite, int notouch));
 _PROTOTYPE( void release, (struct inode *ip, int call_nr, int count)   );
 _PROTOTYPE( void revive, (int proc_nr, int bytes)                      );
 _PROTOTYPE( void suspend, (int task)                                   );
index ac8f8148278962ac919d9f3ae71a4584498a3148..609f009a4125b310323132244262199722b15aaa 100644 (file)
@@ -38,12 +38,6 @@ PRIVATE struct selectentry {
        timer_t timer;  /* if expiry > 0 */
 } selecttab[MAXSELECTS];
 
-#define SELFD_FILE     0
-#define SELFD_PIPE     1
-#define SELFD_TTY      2
-#define SELFD_INET     3
-#define SELFD_LOG      4
-#define SEL_FDS                5
 
 FORWARD _PROTOTYPE(int select_reevaluate, (struct filp *fp));
 
@@ -70,18 +64,14 @@ PRIVATE struct fdtype {
        int (*select_request)(struct filp *, int *ops, int block);      
        int (*select_match)(struct filp *);
        int select_major;
-} fdtypes[SEL_FDS] = {
-               /* SELFD_FILE */
+} fdtypes[] = {
        { select_request_file, select_match_file, 0 },
-               /* SELFD_TTY (also PTY) */
        { select_request_general, NULL, TTY_MAJOR },
-               /* SELFD_INET */
        { select_request_general, NULL, INET_MAJOR },
-               /* SELFD_PIPE (pipe(2) pipes and FS FIFOs) */
        { select_request_pipe, select_match_pipe, 0 },
-               /* SELFD_LOG (/dev/klog) */
        { select_request_general, NULL, LOG_MAJOR },
 };
+#define SEL_FDS                (sizeof(fdtypes) / sizeof(fdtypes[0]))
 
 /* Open Group:
  * "File descriptors associated with regular files shall always select true