diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/diff.c | 4 | ||||
-rw-r--r-- | coreutils/du.c | 18 | ||||
-rw-r--r-- | coreutils/ls.c | 17 |
3 files changed, 6 insertions, 33 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c index 2c89a66e4..12c61ca1e 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
@@ -1114,8 +1114,8 @@ static char **get_dir(char *path) { | |||
1114 | else { | 1114 | else { |
1115 | DIR *dp; | 1115 | DIR *dp; |
1116 | struct dirent *ep; | 1116 | struct dirent *ep; |
1117 | if ((dp = opendir(path)) == NULL) | 1117 | |
1118 | bb_error_msg("Error reading directory"); | 1118 | dp = bb_opendir(path); |
1119 | while ((ep = readdir(dp))) { | 1119 | while ((ep = readdir(dp))) { |
1120 | if ((!strcmp(ep->d_name, "..")) || (!strcmp(ep->d_name, "."))) | 1120 | if ((!strcmp(ep->d_name, "..")) || (!strcmp(ep->d_name, "."))) |
1121 | continue; | 1121 | continue; |
diff --git a/coreutils/du.c b/coreutils/du.c index d453ba412..38790f83b 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -6,20 +6,7 @@ | |||
6 | * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org> | 6 | * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org> |
7 | * Copyright (C) 2002 Edward Betts <edward@debian.org> | 7 | * Copyright (C) 2002 Edward Betts <edward@debian.org> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | 10 | */ |
24 | 11 | ||
25 | /* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ | 12 | /* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ |
@@ -134,9 +121,8 @@ static long du(char *filename) | |||
134 | struct dirent *entry; | 121 | struct dirent *entry; |
135 | char *newfile; | 122 | char *newfile; |
136 | 123 | ||
137 | dir = opendir(filename); | 124 | dir = bb_opendir(filename); |
138 | if (!dir) { | 125 | if (!dir) { |
139 | bb_perror_msg("%s", filename); | ||
140 | status = EXIT_FAILURE; | 126 | status = EXIT_FAILURE; |
141 | return sum; | 127 | return sum; |
142 | } | 128 | } |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 964e7c964..c9d24ff4a 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -3,19 +3,7 @@ | |||
3 | * tiny-ls.c version 0.1.0: A minimalist 'ls' | 3 | * tiny-ls.c version 0.1.0: A minimalist 'ls' |
4 | * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com> | 4 | * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | 7 | */ |
20 | 8 | ||
21 | /* | 9 | /* |
@@ -592,9 +580,8 @@ static struct dnode **list_dir(const char *path) | |||
592 | 580 | ||
593 | dn = NULL; | 581 | dn = NULL; |
594 | nfiles = 0; | 582 | nfiles = 0; |
595 | dir = opendir(path); | 583 | dir = bb_opendir(path); |
596 | if (dir == NULL) { | 584 | if (dir == NULL) { |
597 | bb_perror_msg("%s", path); | ||
598 | status = EXIT_FAILURE; | 585 | status = EXIT_FAILURE; |
599 | return (NULL); /* could not open the dir */ | 586 | return (NULL); /* could not open the dir */ |
600 | } | 587 | } |