Changeset 1b20da0 in mainline for uspace/app/bdsh/cmds/modules/ls/ls.c
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
rdf6ded8 r1b20da0 129 129 * 0 otherwise. 130 130 */ 131 static signed int ls_scan_dir(const char *d, DIR *dirp, 131 static signed int ls_scan_dir(const char *d, DIR *dirp, 132 132 struct dir_elem_t **dir_list_ptr) 133 133 { … … 198 198 /* Populate the directory list. */ 199 199 if (ls.recursive) { 200 tmp = (struct dir_elem_t *) realloc(*dir_list_ptr, 200 tmp = (struct dir_elem_t *) realloc(*dir_list_ptr, 201 201 nbdirs * sizeof(struct dir_elem_t)); 202 202 if (!tmp) { 203 203 cli_error(CL_ENOMEM, "ls: failed to scan %s", d); 204 204 goto out; 205 } 205 } 206 206 *dir_list_ptr = tmp; 207 207 … … 253 253 } 254 254 255 nbdirs = ls_scan_dir(path, dirp, &dir_list); 255 nbdirs = ls_scan_dir(path, dirp, &dir_list); 256 256 if (nbdirs == -1) { 257 257 ret = CMD_FAILURE; … … 292 292 ret = CMD_FAILURE; 293 293 goto out; 294 } 294 } 295 295 } 296 296 297 ret = CMD_SUCCESS; 297 ret = CMD_SUCCESS; 298 298 299 299 out: … … 405 405 if (ls.recursive) 406 406 ret = ls_recursive(de.name, dirp); 407 else 407 else 408 408 ret = ls_scan_dir(de.name, dirp, NULL); 409 409
Note:
See TracChangeset
for help on using the changeset viewer.