Changes in uspace/app/bdsh/cmds/modules/ls/ls.c [6afc9d7:26c02b22] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
r6afc9d7 r26c02b22 31 31 * As more stuff is completed and exposed in libc, this will improve */ 32 32 33 #include <errno.h>34 33 #include <stdio.h> 35 34 #include <stdlib.h> … … 188 187 if (rc != 0) { 189 188 printf("ls: skipping bogus node %s\n", buff); 190 printf(" error=%d\n", errno);189 printf("rc=%d\n", rc); 191 190 goto out; 192 191 } … … 315 314 static unsigned int ls_scope(const char *path, struct dir_elem_t *de) 316 315 { 317 if (stat(path, &de->s) != 0) {316 if (stat(path, &de->s)) { 318 317 cli_error(CL_ENOENT, "%s", path); 319 318 return LS_BOGUS; … … 363 362 argc = cli_count_args(argv); 364 363 365 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {364 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 366 365 c = getopt_long(argc, argv, "hur", long_options, &opt_ind); 367 366 switch (c) { … … 377 376 } 378 377 } 379 378 380 379 argc -= optind; 381 380 382 381 de.name = (char *) malloc(PATH_MAX); 383 382 if (!de.name) { 384 cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);383 cli_error(CL_ENOMEM, "%s: ", cmdname); 385 384 return CMD_FAILURE; 386 385 } 387 386 memset(de.name, 0, PATH_MAX); 388 389 if (argc == 0) { 390 if (getcwd(de.name, PATH_MAX) == NULL) { 391 cli_error(CL_EFAIL, "%s: Failed determining working " 392 "directory", cmdname); 393 return CMD_FAILURE; 394 } 395 } else { 387 388 if (argc == 0) 389 getcwd(de.name, PATH_MAX); 390 else 396 391 str_cpy(de.name, PATH_MAX, argv[optind]); 397 }398 392 399 393 scope = ls_scope(de.name, &de);
Note:
See TracChangeset
for help on using the changeset viewer.