Commit 11fde63
authored
du: logic correction for -s option
* The function traverse() takes a directory name param and first does stat() or lstat() depending on other command options
* If stat() fails, error is printed, final exit code is set to 1 and the function returns early to avoid printing a total
* The same error logic should happen for later opendir() failure, otherwise an unhelpful total will be printed after the error message if the -s option is used
* I verified this by forcing opendir to fail1 parent 8359313 commit 11fde63
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
0 commit comments