style fixes

last xcalloc replaced by xzalloc
This commit is contained in:
Denis Vlasenko
2006-12-26 10:42:51 +00:00
parent 5dd7ef0f37
commit bf0a201008
39 changed files with 114 additions and 118 deletions

View File

@ -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;
}