diff options
Diffstat (limited to 'procps/sysctl.c')
-rw-r--r-- | procps/sysctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/procps/sysctl.c b/procps/sysctl.c index 7c72ac933..2c3fda5fe 100644 --- a/procps/sysctl.c +++ b/procps/sysctl.c | |||
@@ -301,14 +301,16 @@ int sysctl_display_all(const char *path, int output, int show_table) | |||
301 | char *tmpdir; | 301 | char *tmpdir; |
302 | struct stat ts; | 302 | struct stat ts; |
303 | 303 | ||
304 | if (!(dp = opendir(path))) { | 304 | dp = opendir(path); |
305 | if (!dp) { | ||
305 | retval = -1; | 306 | retval = -1; |
306 | } else { | 307 | } else { |
307 | while ((de = readdir(dp)) != NULL) { | 308 | while ((de = readdir(dp)) != NULL) { |
308 | tmpdir = concat_subpath_file(path, de->d_name); | 309 | tmpdir = concat_subpath_file(path, de->d_name); |
309 | if(tmpdir == NULL) | 310 | if (tmpdir == NULL) |
310 | continue; | 311 | continue; |
311 | if ((retval2 = stat(tmpdir, &ts)) != 0) | 312 | retval2 = stat(tmpdir, &ts); |
313 | if (retval2 != 0) | ||
312 | bb_perror_msg(tmpdir); | 314 | bb_perror_msg(tmpdir); |
313 | else { | 315 | else { |
314 | if (S_ISDIR(ts.st_mode)) { | 316 | if (S_ISDIR(ts.st_mode)) { |