Rev 2927 | Rev 4389 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2927 | Rev 3219 | ||
---|---|---|---|
Line 95... | Line 95... | ||
95 | } |
95 | } |
96 | 96 | ||
97 | /** Release file descriptor. |
97 | /** Release file descriptor. |
98 | * |
98 | * |
99 | * @param fd File descriptor being released. |
99 | * @param fd File descriptor being released. |
- | 100 | * |
|
- | 101 | * @return EOK on success or EBADF if fd is an invalid file |
|
- | 102 | * descriptor. |
|
100 | */ |
103 | */ |
101 | void vfs_fd_free(int fd) |
104 | int vfs_fd_free(int fd) |
102 | { |
105 | { |
103 | assert(fd < MAX_OPEN_FILES); |
106 | if ((fd >= MAX_OPEN_FILES) || (files[fd] == NULL)) |
104 | assert(files[fd] != NULL); |
107 | return EBADF; |
105 | vfs_file_delref(files[fd]); |
108 | vfs_file_delref(files[fd]); |
106 | files[fd] = NULL; |
109 | files[fd] = NULL; |
- | 110 | return EOK; |
|
107 | } |
111 | } |
108 | 112 | ||
109 | /** Increment reference count of VFS file structure. |
113 | /** Increment reference count of VFS file structure. |
110 | * |
114 | * |
111 | * @param file File structure that will have reference count |
115 | * @param file File structure that will have reference count |