aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-06-10 17:22:49 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-06-10 17:22:49 +0000
commit0e39734a344db1a9dd4414ce5ae1397a868d1b13 (patch)
tree805a4197b8a0d36eaa6880dfc23d8c2539359fe9 /libbb
parentabf64ab3b83d82131f0956d9b375106b2a822f1d (diff)
downloadbusybox-w32-0e39734a344db1a9dd4414ce5ae1397a868d1b13.tar.gz
busybox-w32-0e39734a344db1a9dd4414ce5ae1397a868d1b13.tar.bz2
busybox-w32-0e39734a344db1a9dd4414ce5ae1397a868d1b13.zip
Vodz, last_patch_88
git-svn-id: svn://busybox.net/trunk/busybox@6906 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/find_root_device.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index b12d392a2..654f17145 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -48,11 +48,14 @@ extern char *find_real_root_device_name(const char* name)
48 bb_perror_msg("could not open '/dev'"); 48 bb_perror_msg("could not open '/dev'");
49 else { 49 else {
50 while((entry = readdir(dir)) != NULL) { 50 while((entry = readdir(dir)) != NULL) {
51 51 const char *name = entry->d_name;
52 fileName = concat_subpath_file("/dev", entry->d_name); 52 /* Must skip ".." since that is "/", and so we
53 if(fileName == NULL) 53 * would get a false positive on ".." */
54 if (name[0] == '.' && name[1] == '.' && !name[2])
54 continue; 55 continue;
55 56
57 fileName = concat_path_file("/dev", name);
58
56 /* Some char devices have the same dev_t as block 59 /* Some char devices have the same dev_t as block
57 * devices, so make sure this is a block device */ 60 * devices, so make sure this is a block device */
58 if (stat(fileName, &statBuf) == 0 && 61 if (stat(fileName, &statBuf) == 0 &&
@@ -66,7 +69,7 @@ extern char *find_real_root_device_name(const char* name)
66 } 69 }
67 } 70 }
68 if(fileName==NULL) 71 if(fileName==NULL)
69 fileName=bb_xstrdup("/dev/root"); 72 fileName = bb_xstrdup("/dev/root");
70 return fileName; 73 return fileName;
71} 74}
72 75