Changes in uspace/srv/vfs/vfs_ops.c [d2c8533:6ad454f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
rd2c8533 r6ad454f 86 86 } 87 87 88 int vfs_op_clone(int oldfd, int newfd, bool desc )88 int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd) 89 89 { 90 90 int rc; … … 102 102 103 103 if (newfd != -1) { 104 /* Make sure newfd is closed. */105 (void) vfs_fd_free(newfd);106 104 /* Assign the old file to newfd. */ 107 105 rc = vfs_fd_assign(oldfile, newfd); 106 *out_fd = newfd; 108 107 } else { 109 108 vfs_file_t *newfile; 110 int newfd = vfs_fd_alloc(&newfile, desc);111 if ( newfd >= 0) {109 rc = vfs_fd_alloc(&newfile, desc, out_fd); 110 if (rc == EOK) { 112 111 newfile->node = oldfile->node; 113 112 newfile->permissions = oldfile->permissions; … … 116 115 vfs_file_put(newfile); 117 116 } 118 rc = newfd;119 117 } 120 118 vfs_file_put(oldfile); … … 225 223 226 224 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags, 227 unsigned instance, const char *opts, const char *fs_name, int *out fd)225 unsigned instance, const char *opts, const char *fs_name, int *out_fd) 228 226 { 229 227 int rc; 230 228 vfs_file_t *mp = NULL; 231 229 vfs_file_t *file = NULL; 232 intfd = -1;230 *out_fd = -1; 233 231 234 232 if (!(flags & VFS_MOUNT_CONNECT_ONLY)) { … … 256 254 257 255 if (!(flags & VFS_MOUNT_NO_REF)) { 258 fd = vfs_fd_alloc(&file, false); 259 if (fd < 0) { 260 rc = fd; 256 rc = vfs_fd_alloc(&file, false, out_fd); 257 if (rc != EOK) { 261 258 goto out; 262 259 } … … 297 294 vfs_file_put(file); 298 295 299 if (rc != EOK && fd >= 0) { 300 vfs_fd_free(fd); 301 fd = 0; 302 } 303 304 *outfd = fd; 296 if (rc != EOK && *out_fd >= 0) { 297 vfs_fd_free(*out_fd); 298 *out_fd = -1; 299 } 300 305 301 return rc; 306 302 } … … 830 826 } 831 827 832 int vfs_op_wait_handle(bool high_fd )833 { 834 return vfs_wait_handle_internal(high_fd );828 int vfs_op_wait_handle(bool high_fd, int *out_fd) 829 { 830 return vfs_wait_handle_internal(high_fd, out_fd); 835 831 } 836 832 … … 894 890 895 891 vfs_file_t *file; 896 int fd = vfs_fd_alloc(&file, false);897 if ( fd < 0) {892 rc = vfs_fd_alloc(&file, false, out_fd); 893 if (rc != EOK) { 898 894 vfs_node_put(node); 899 895 vfs_file_put(parent); 900 return fd;896 return rc; 901 897 } 902 898 assert(file != NULL); … … 912 908 fibril_rwlock_read_unlock(&namespace_rwlock); 913 909 914 *out_fd = fd;915 910 return EOK; 916 911 }
Note:
See TracChangeset
for help on using the changeset viewer.