projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Vodz, last_patch_114
[oweals/busybox.git]
/
libbb
/
find_root_device.c
diff --git
a/libbb/find_root_device.c
b/libbb/find_root_device.c
index 0a3f1bc77eb65749e9b44842d9b35a00347cd84d..c595321dfe832f0197e2363047a387f997664edf 100644
(file)
--- a/
libbb/find_root_device.c
+++ b/
libbb/find_root_device.c
@@
-2,9
+2,7
@@
/*
* Utility routines.
*
/*
* Utility routines.
*
- * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
- * Patched by a bunch of people. Feel free to acknowledge your work.
+ * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-38,23
+36,23
@@
extern char *find_real_root_device_name(const char* name)
dev_t dev;
if (stat("/", &rootStat) != 0)
dev_t dev;
if (stat("/", &rootStat) != 0)
- perror_msg("could not stat '/'");
+
bb_
perror_msg("could not stat '/'");
else {
if ((dev = rootStat.st_rdev)==0)
dev=rootStat.st_dev;
dir = opendir("/dev");
if (!dir)
else {
if ((dev = rootStat.st_rdev)==0)
dev=rootStat.st_dev;
dir = opendir("/dev");
if (!dir)
- perror_msg("could not open '/dev'");
+
bb_
perror_msg("could not open '/dev'");
else {
while((entry = readdir(dir)) != NULL) {
else {
while((entry = readdir(dir)) != NULL) {
-
- /* Must skip ".." since that is "/", and so we
+ const char *myname = entry->d_name;
+ /* Must skip ".." since that is "/", and so we
* would get a false positive on ".." */
* would get a false positive on ".." */
- if (
strcmp(entry->d_name, "..") == 0
)
+ if (
myname[0] == '.' && myname[1] == '.' && !myname[2]
)
continue;
continue;
- fileName = concat_path_file("/dev",
entry->d_
name);
+ fileName = concat_path_file("/dev",
my
name);
/* Some char devices have the same dev_t as block
* devices, so make sure this is a block device */
/* Some char devices have the same dev_t as block
* devices, so make sure this is a block device */
@@
-69,7
+67,7
@@
extern char *find_real_root_device_name(const char* name)
}
}
if(fileName==NULL)
}
}
if(fileName==NULL)
- fileName
=
xstrdup("/dev/root");
+ fileName
= bb_
xstrdup("/dev/root");
return fileName;
}
return fileName;
}