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