mount: style fixes
This commit is contained in:
parent
66fabdb631
commit
8d474b5009
@ -167,7 +167,8 @@ static llist_t *get_block_backed_filesystems(void)
|
||||
FILE *f;
|
||||
|
||||
for (i = 0; filesystems[i]; i++) {
|
||||
if(!(f = fopen(filesystems[i], "r"))) continue;
|
||||
f = fopen(filesystems[i], "r");
|
||||
if (!f) continue;
|
||||
|
||||
for (fs = buf = 0; (fs = buf = bb_get_chomped_line_from_file(f));
|
||||
free(buf))
|
||||
@ -206,11 +207,12 @@ static int fakeIt;
|
||||
#endif
|
||||
|
||||
// Perform actual mount of specific filesystem at specific location.
|
||||
// NB: mp->xxx fields may be trashed on exit
|
||||
static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (fakeIt) { return 0; }
|
||||
if (fakeIt) return 0;
|
||||
|
||||
// Mount, with fallback to read-only if necessary.
|
||||
|
||||
@ -440,7 +442,6 @@ enum {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* We want to be able to compile mount on old kernels in such a way
|
||||
* that the binary will work well on more recent kernels.
|
||||
@ -1385,7 +1386,8 @@ static int singlemount(struct mntent *mp, int ignore_busy)
|
||||
for (fl = fslist; fl; fl = fl->link) {
|
||||
mp->mnt_type = fl->data;
|
||||
|
||||
if (!(rc = mount_it_now(mp,vfsflags, filteropts))) break;
|
||||
rc = mount_it_now(mp,vfsflags, filteropts);
|
||||
if (!rc) break;
|
||||
|
||||
mp->mnt_type = 0;
|
||||
}
|
||||
@ -1521,14 +1523,15 @@ int mount_main(int argc, char **argv)
|
||||
fstabname = bb_path_mtab_file;
|
||||
else fstabname="/etc/fstab";
|
||||
|
||||
if (!(fstab=setmntent(fstabname,"r")))
|
||||
fstab = setmntent(fstabname,"r");
|
||||
if (!fstab)
|
||||
bb_perror_msg_and_die("cannot read %s",fstabname);
|
||||
|
||||
// Loop through entries until we find what we're looking for.
|
||||
|
||||
memset(mtpair,0,sizeof(mtpair));
|
||||
for (;;) {
|
||||
struct mntent *mtnext = mtpair + (mtcur==mtpair ? 1 : 0);
|
||||
struct mntent *mtnext = (mtcur==mtpair ? mtpair+1 : mtpair);
|
||||
|
||||
// Get next fstab entry
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user