Changeset d6084ef in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2008-03-02T15:05:26Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dadcec1
- Parents:
- 9bb85f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r9bb85f3 rd6084ef 76 76 }; 77 77 78 return vfs_lookup_internal("/", strlen("/"), L_DIRECTORY, result, 79 &altroot); 78 return vfs_lookup_internal("/", L_DIRECTORY, result, &altroot); 80 79 } 81 80 … … 150 149 /* Allocate buffer for the mount point data being received. */ 151 150 uint8_t *buf; 152 buf = malloc(size );151 buf = malloc(size + 1); 153 152 if (!buf) { 154 153 ipc_answer_0(callid, ENOMEM); … … 159 158 /* Deliver the mount point. */ 160 159 (void) ipc_data_write_finalize(callid, buf, size); 160 buf[size] = '\0'; 161 161 162 162 /* … … 187 187 /* We already have the root FS. */ 188 188 rwlock_write_lock(&namespace_rwlock); 189 rc = vfs_lookup_internal(buf, size, L_DIRECTORY, &mp_res, 190 NULL); 189 rc = vfs_lookup_internal(buf, L_DIRECTORY, &mp_res, NULL); 191 190 if (rc != EOK) { 192 191 /* The lookup failed for some reason. */ … … 315 314 * directly into the PLB using some kind of a callback. 316 315 */ 317 char *path = malloc(len );316 char *path = malloc(len + 1); 318 317 319 318 if (!path) { … … 329 328 return; 330 329 } 330 path[len] = '\0'; 331 331 332 332 /* … … 342 342 /* The path is now populated and we can call vfs_lookup_internal(). */ 343 343 vfs_lookup_res_t lr; 344 rc = vfs_lookup_internal(path, l en, lflag, &lr, NULL);344 rc = vfs_lookup_internal(path, lflag, &lr, NULL); 345 345 if (rc) { 346 346 if (lflag & L_CREATE) … … 637 637 * directly into the PLB using some kind of a callback. 638 638 */ 639 char *path = malloc(len );639 char *path = malloc(len + 1); 640 640 641 641 if (!path) { … … 651 651 return; 652 652 } 653 path[len] = '\0'; 653 654 654 655 rwlock_write_lock(&namespace_rwlock); 655 656 int lflag = L_DIRECTORY | L_CREATE | L_EXCLUSIVE; 656 rc = vfs_lookup_internal(path, l en, lflag, NULL, NULL);657 rc = vfs_lookup_internal(path, lflag, NULL, NULL); 657 658 rwlock_write_unlock(&namespace_rwlock); 658 659 free(path); … … 679 680 * directly into the PLB using some kind of a callback. 680 681 */ 681 char *path = malloc(len );682 char *path = malloc(len + 1); 682 683 683 684 if (!path) { … … 693 694 return; 694 695 } 696 path[len] = '\0'; 695 697 696 698 rwlock_write_lock(&namespace_rwlock); 697 699 lflag &= L_DIRECTORY; /* sanitize lflag */ 698 700 vfs_lookup_res_t lr; 699 rc = vfs_lookup_internal(path, l en, lflag | L_DESTROY, &lr, NULL);701 rc = vfs_lookup_internal(path, lflag | L_DESTROY, &lr, NULL); 700 702 free(path); 701 703 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.