]> Zhao Yanbai Git Server - minix.git/commitdiff
Add return statement after failed dev_open (fixes open count in at_wini)
authorThomas Veerman <thomas@minix3.org>
Thu, 21 Jan 2010 15:02:29 +0000 (15:02 +0000)
committerThomas Veerman <thomas@minix3.org>
Thu, 21 Jan 2010 15:02:29 +0000 (15:02 +0000)
servers/vfs/open.c

index 93cf8e889ebd20fffcf710e6d6742a15bd7378c7..705a770b85e69cfb8e104a786e47edb4bfec2b42 100644 (file)
@@ -142,6 +142,7 @@ PRIVATE int common_open(register int oflags, mode_t omode)
                        /* Invoke the driver for special processing. */
                        dev = (dev_t) vp->v_sdev;
                        r = dev_open(dev, who_e, bits | (oflags & ~O_ACCMODE));
+                       if (r != OK) break;
 
                        /* Check whether the device is mounted or not. If so,
                           then that FS is responsible for this device. Else
@@ -624,8 +625,9 @@ struct filp *fp;
                }
                /* Do any special processing on device close. */
                (void) dev_close(dev, fp-filp);
-
                /* Ignore any errors, even SUSPEND. */
+
+               fp->filp_mode = FILP_CLOSED;
        }
   }