From f86fa6c7483f6fee33fb128fced4644ec876a1bc Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 20 Aug 2000 21:51:24 +0000 Subject: [PATCH] finddev.c: Fix stupid bug in finddev.c which could cause things to loop if the stat call failed. --- lib/ext2fs/finddev.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c index 940108e..7609f0c 100644 --- a/lib/ext2fs/finddev.c +++ b/lib/ext2fs/finddev.c @@ -36,12 +36,6 @@ struct dir_list { struct dir_list *next; }; -#ifdef sun -#define DEVDIR "/devices" -#else -#define DEVDIR "/dev" -#endif - /* * This function adds an entry to the directory list */ @@ -99,7 +93,7 @@ static int scan_dir(char *dirname, dev_t device, struct dir_list **list, goto skip_to_next; sprintf(path, "%s/%s", dirname, dp->d_name); if (stat(path, &st) < 0) - continue; + goto skip_to_next; if (S_ISDIR(st.st_mode)) add_to_dirlist(path, list); if (S_ISBLK(st.st_mode) && st.st_rdev == device) { -- 1.8.3.1