Changeset 6ad454f in mainline for uspace/srv/vfs/vfs_file.c
- Timestamp:
- 2017-12-08T21:03:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a8c7a6d
- Parents:
- 9246016
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 06:01:16)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_file.c
r9246016 r6ad454f 192 192 } 193 193 194 static int _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc )194 static int _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc, int *out_fd) 195 195 { 196 196 if (!vfs_files_init(vfs_data)) … … 223 223 224 224 fibril_mutex_unlock(&vfs_data->lock); 225 return (int) i; 225 *out_fd = (int) i; 226 return EOK; 226 227 } 227 228 … … 249 250 * in a descending order. 250 251 * 251 * @return First available file descriptor or a negative error 252 * code. 253 */ 254 int vfs_fd_alloc(vfs_file_t **file, bool desc) 255 { 256 return _vfs_fd_alloc(VFS_DATA, file, desc); 252 * @param[out] out_fd First available file descriptor 253 * 254 * @return Error code. 255 */ 256 int vfs_fd_alloc(vfs_file_t **file, bool desc, int *out_fd) 257 { 258 return _vfs_fd_alloc(VFS_DATA, file, desc, out_fd); 257 259 } 258 260 … … 427 429 } 428 430 429 int vfs_wait_handle_internal(bool high_fd )431 int vfs_wait_handle_internal(bool high_fd, int *out_fd) 430 432 { 431 433 vfs_client_data_t *vfs_data = VFS_DATA; … … 441 443 442 444 vfs_file_t *file; 443 int fd = _vfs_fd_alloc(vfs_data, &file, high_fd);444 if ( fd < 0) {445 int rc = _vfs_fd_alloc(vfs_data, &file, high_fd, out_fd); 446 if (rc != EOK) { 445 447 vfs_node_delref(bh->node); 446 448 free(bh); 447 return fd;449 return rc; 448 450 } 449 451 … … 452 454 vfs_file_put(file); 453 455 free(bh); 454 return fd;456 return EOK; 455 457 } 456 458
Note:
See TracChangeset
for help on using the changeset viewer.