Changes in uspace/srv/vfs/vfs_ops.c [25a179e:d2c8533] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r25a179e 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); … … 152 154 &answer); 153 155 /* Send the mount options */ 154 int rc = async_data_write_start(exch, options, str_size(options));156 sysarg_t rc = async_data_write_start(exch, options, str_size(options)); 155 157 if (rc != EOK) { 156 158 async_forget(msg); … … 192 194 { 193 195 fs_handle_t fs_handle = 0; 194 int rc;196 sysarg_t rc; 195 197 int retval; 196 198 … … 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 } … … 398 402 } 399 403 400 int rc;404 sysarg_t rc; 401 405 async_wait_for(msg, &rc); 402 406 … … 677 681 vfs_exchange_release(fs_exch); 678 682 679 int rc;683 sysarg_t rc; 680 684 async_wait_for(msg, &rc); 681 685 … … 689 693 { 690 694 async_exch_t *exch = vfs_exchange_grab(fs_handle); 691 int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,695 sysarg_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE, 692 696 (sysarg_t) service_id, (sysarg_t) index, LOWER32(size), 693 697 UPPER32(size)); … … 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.