Fixes bug in close_all_files()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 24 Aug 2010 22:49:03 +0000 (15:49 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:53 +0000 (17:35 -0700)
kern/src/vfs.c

index 464714d..743413b 100644 (file)
@@ -1614,8 +1614,9 @@ void close_all_files(struct files_struct *open_files, bool cloexec)
                         * have a valid fdset higher than files */
                        assert(i < open_files->max_files);
                        file = open_files->fd[i];
-                       if (cloexec && !(file->f_flags | O_CLOEXEC))
+                       if (cloexec && !(file->f_flags & O_CLOEXEC))
                                continue;
+                       /* Actually close the file */
                        open_files->fd[i] = 0;
                        assert(file);
                        kref_put(&file->f_kref);