Fixes buggy assert in __claim_fd()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 19 Aug 2014 17:42:15 +0000 (10:42 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 19 Aug 2014 17:42:15 +0000 (10:42 -0700)
Was checking FD 0, instead of the FD we claimed.

kern/src/vfs.c

index cc0a165..e333612 100644 (file)
@@ -2226,7 +2226,8 @@ static int __claim_fd(struct files_struct *open_files, int file_desc)
                return -ENFILE; /* Should never really happen. Here to catch bugs. */
 
        SET_BITMASK_BIT(open_files->open_fds->fds_bits, file_desc);
-       assert(file_desc < open_files->max_files && open_files->fd[0].fd_file == 0);
+       assert(file_desc < open_files->max_files &&
+              open_files->fd[file_desc].fd_file == 0);
        if (file_desc >= open_files->next_fd)
                open_files->next_fd = file_desc + 1;
        return 0;