summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/file.c b/file.c
index 297fd1c..9bd6ece 100644
--- a/file.c
+++ b/file.c
@@ -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.