Changeset f77c1c9 in mainline for uspace/app/bdsh
- Timestamp:
- 2017-12-08T21:03:35Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c19a5a59
- Parents:
- c1694b6b
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 19:44:55)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
- Location:
- uspace/app/bdsh
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
rc1694b6b rf77c1c9 195 195 /* Allow storing the whole UTF-8 character. */ 196 196 blen = STR_BOUNDS(1); 197 } else 198 fd = vfs_lookup_open(fname, WALK_REGULAR, MODE_READ); 197 } else { 198 int rc = vfs_lookup_open(fname, WALK_REGULAR, MODE_READ, &fd); 199 if (rc != EOK) { 200 fd = -1; 201 } 202 } 199 203 200 204 if (fd < 0) { -
uspace/app/bdsh/cmds/modules/cmp/cmp.c
rc1694b6b rf77c1c9 80 80 81 81 for (int i = 0; i < 2; i++) { 82 fd[i] = vfs_lookup_open(fn[i], WALK_REGULAR, MODE_READ); 83 if (fd[i] < 0) { 84 rc = fd[i]; 82 rc = vfs_lookup_open(fn[i], WALK_REGULAR, MODE_READ, &(fd[i])); 83 if (rc != EOK) { 85 84 printf("Unable to open %s\n", fn[i]); 86 85 goto end; -
uspace/app/bdsh/cmds/modules/cp/cp.c
rc1694b6b rf77c1c9 394 394 printf("Copying %s to %s\n", src, dest); 395 395 396 fd1 = vfs_lookup_open(src, WALK_REGULAR, MODE_READ);397 if ( fd1 < 0) {396 rc = vfs_lookup_open(src, WALK_REGULAR, MODE_READ, &fd1); 397 if (rc != EOK) { 398 398 printf("Unable to open source file %s\n", src); 399 399 return -1; 400 400 } 401 401 402 fd2 = vfs_lookup_open(dest, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE);403 if ( fd2 < 0) {402 rc = vfs_lookup_open(dest, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE, &fd2); 403 if (rc != EOK) { 404 404 printf("Unable to open destination file %s\n", dest); 405 405 vfs_put(fd1); -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
rc1694b6b rf77c1c9 163 163 file_name = argv[optind]; 164 164 165 fd = vfs_lookup_open(file_name, WALK_REGULAR | WALK_MUST_CREATE, MODE_WRITE);166 if ( fd < 0) {165 rc = vfs_lookup_open(file_name, WALK_REGULAR | WALK_MUST_CREATE, MODE_WRITE, &fd); 166 if (rc != EOK) { 167 167 printf("%s: failed to create file %s.\n", cmdname, file_name); 168 168 return CMD_FAILURE; -
uspace/app/bdsh/cmds/modules/rm/rm.c
rc1694b6b rf77c1c9 149 149 } 150 150 151 fd = vfs_lookup(path, WALK_REGULAR); 152 if (fd >= 0) { 151 if (vfs_lookup(path, WALK_REGULAR, &fd) == EOK) { 153 152 vfs_put(fd); 154 153 return RM_FILE; -
uspace/app/bdsh/cmds/modules/touch/touch.c
rc1694b6b rf77c1c9 123 123 if ((!no_create) || 124 124 ((no_create) && (vfs_stat_path(buff, &file_stat) == EOK))) { 125 fd = vfs_lookup(buff, WALK_REGULAR | WALK_MAY_CREATE); 125 int rc = vfs_lookup(buff, WALK_REGULAR | WALK_MAY_CREATE, &fd); 126 if (rc != EOK) { 127 fd = -1; 128 } 126 129 } 127 130 -
uspace/app/bdsh/exec.c
rc1694b6b rf77c1c9 58 58 int fd; 59 59 60 fd = vfs_lookup_open(f, WALK_REGULAR, MODE_READ);61 if ( fd >= 0) {60 int rc = vfs_lookup_open(f, WALK_REGULAR, MODE_READ, &fd); 61 if (rc == EOK) { 62 62 vfs_put(fd); 63 63 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.