]> Zhao Yanbai Git Server - minix.git/commitdiff
Support for O_REOPEN flag and pass the filp numbet to dev_open.
authorPhilip Homburg <philip@cs.vu.nl>
Fri, 22 Feb 2008 14:49:02 +0000 (14:49 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Fri, 22 Feb 2008 14:49:02 +0000 (14:49 +0000)
servers/vfs/misc.c

index 5d24df96c2526d9c701ff147fd4250ade712fc77..f1a41b07fdb550dcfc40f07969be80349aa0716c 100644 (file)
@@ -194,7 +194,7 @@ PUBLIC int do_fcntl()
 
      case F_SETFL:
        /* Set file status flags (O_NONBLOCK and O_APPEND). */
-       fl = O_NONBLOCK | O_APPEND;
+       fl = O_NONBLOCK | O_APPEND | O_REOPEN;
        f->filp_flags = (f->filp_flags & ~fl) | (m_in.addr & fl);
        return(OK);
 
@@ -457,7 +457,10 @@ PRIVATE void free_proc(struct fproc *exiter, int flags)
                vp = rfilp->filp_vno;
                if ((vp->v_mode & I_TYPE) != I_CHAR_SPECIAL) continue;
                if ((dev_t) vp->v_sdev != dev) continue;
-               dev_close(dev);
+
+               (void) dev_close(dev, rfilp-filp);
+               /* Ignore any errors, even SUSPEND. */
+
                rfilp->filp_mode = FILP_CLOSED;
           }
       }