summaryrefslogtreecommitdiff
path: root/libbb/find_root_device.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-26 10:42:51 +0000
committerDenis Vlasenko2006-12-26 10:42:51 +0000
commitbf0a201008671f81c107de72c026b1b84967561d (patch)
treeaf74820b70fa27929fe218c95822c20651b60637 /libbb/find_root_device.c
parent5dd7ef0f37373e397a7160cb431a32ae57f9f7d9 (diff)
downloadbusybox-bf0a201008671f81c107de72c026b1b84967561d.zip
busybox-bf0a201008671f81c107de72c026b1b84967561d.tar.gz
style fixes
last xcalloc replaced by xzalloc
Diffstat (limited to 'libbb/find_root_device.c')
-rw-r--r--libbb/find_root_device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index 71b79b8..1d74d1e 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -17,12 +17,13 @@ char *find_block_device(char *path)
dev_t dev;
char *retpath=NULL;
- if(stat(path, &st) || !(dir = opendir("/dev"))) return NULL;
+ if (stat(path, &st) || !(dir = opendir("/dev")))
+ return NULL;
dev = (st.st_mode & S_IFMT) == S_IFBLK ? st.st_rdev : st.st_dev;
- while((entry = readdir(dir)) != NULL) {
+ while ((entry = readdir(dir)) != NULL) {
char devpath[PATH_MAX];
sprintf(devpath,"/dev/%s", entry->d_name);
- if(!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
+ if (!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
retpath = xstrdup(devpath);
break;
}