diff options
| author | rsc <rsc> | 2007-08-27 14:35:09 +0000 |
|---|---|---|
| committer | rsc <rsc> | 2007-08-27 14:35:09 +0000 |
| commit | 1ccff18b2404e18fc889901f85b72777193c0b3f (patch) | |
| tree | d941f80dbef7df236c522eeee8bbf8b8c27b8663 /file.c | |
| parent | 7895178df374a1a89c193e5c83a37a35243aadc2 (diff) | |
| download | xv6-labs-2022-1ccff18b2404e18fc889901f85b72777193c0b3f.tar.xz xv6-labs-2022-1ccff18b2404e18fc889901f85b72777193c0b3f.zip | |
fileincref -> filedup (consistent with idup)
Diffstat (limited to 'file.c')
| -rw-r--r-- | file.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -41,14 +41,15 @@ filealloc(void) } // Increment ref count for file f. -void -fileincref(struct file *f) +struct file* +filedup(struct file *f) { acquire(&file_table_lock); if(f->ref < 1 || f->type == FD_CLOSED) - panic("fileincref"); + panic("filedup"); f->ref++; release(&file_table_lock); + return f; } // Read from file f. Addr is kernel address. |
