Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154956518
D8678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D8678.diff
View Options
Index: head/lib/libstand/dosfs.c
===================================================================
--- head/lib/libstand/dosfs.c
+++ head/lib/libstand/dosfs.c
@@ -204,7 +204,7 @@
if (buf != NULL)
free(buf);
(void)dosunmount(fs);
- return(err);
+ return (err);
}
free(buf);
@@ -219,7 +219,7 @@
fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff;
fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff;
}
- return 0;
+ return (0);
}
/*
@@ -231,10 +231,10 @@
int err;
if (fs->links)
- return(EBUSY);
+ return (EBUSY);
if ((err = dosunmount(fs)))
- return(err);
- return 0;
+ return (err);
+ return (0);
}
/*
@@ -244,7 +244,7 @@
dosunmount(DOS_FS *fs)
{
free(fs);
- return(0);
+ return (0);
}
/*
@@ -285,7 +285,7 @@
fd->f_fsdata = (void *)f;
out:
- return(err);
+ return (err);
}
/*
@@ -307,7 +307,7 @@
twiddle(4);
nb = (u_int)nbyte;
if ((size = fsize(f->fs, &f->de)) == -1)
- return EINVAL;
+ return (EINVAL);
if (nb > (n = size - f->offset))
nb = n;
off = f->offset;
@@ -344,7 +344,7 @@
out:
if (resid)
*resid = nbyte - nb + cnt;
- return(err);
+ return (err);
}
/*
@@ -370,16 +370,16 @@
break;
default:
errno = EINVAL;
- return(-1);
+ return (-1);
}
off += offset;
if (off < 0 || off > size) {
errno = EINVAL;
- return(-1);
+ return (-1);
}
f->offset = (u_int)off;
f->c = 0;
- return(off);
+ return (off);
}
/*
@@ -394,7 +394,7 @@
f->fs->links--;
free(f);
dos_unmount(fs);
- return 0;
+ return (0);
}
/*
@@ -411,7 +411,7 @@
sb->st_uid = 0;
sb->st_gid = 0;
if ((sb->st_size = fsize(f->fs, &f->de)) == -1)
- return EINVAL;
+ return (EINVAL);
return (0);
}
@@ -501,7 +501,7 @@
d->d_reclen = sizeof(*d);
d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG;
memcpy(d->d_name, fn, sizeof(d->d_name));
- return(0);
+ return (0);
}
/*
@@ -516,41 +516,41 @@
bs->jmp[0] != 0xe9 &&
(bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) ||
bs->bpb.media < 0xf0)
- return EINVAL;
+ return (EINVAL);
if (cv2(bs->bpb.secsiz) != SECSIZ)
- return EINVAL;
+ return (EINVAL);
if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1))
- return EINVAL;
+ return (EINVAL);
fs->bsize = secbyt(fs->spc);
fs->bshift = ffs(fs->bsize) - 1;
if ((fs->spf = cv2(bs->bpb.spf))) {
if (bs->bpb.fats != 2)
- return EINVAL;
+ return (EINVAL);
if (!(fs->dirents = cv2(bs->bpb.dirents)))
- return EINVAL;
+ return (EINVAL);
} else {
if (!(fs->spf = cv4(bs->bpb.lspf)))
- return EINVAL;
+ return (EINVAL);
if (!bs->bpb.fats || bs->bpb.fats > 16)
- return EINVAL;
+ return (EINVAL);
if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS)
- return EINVAL;
+ return (EINVAL);
}
if (!(fs->lsnfat = cv2(bs->bpb.ressec)))
- return EINVAL;
+ return (EINVAL);
fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats;
fs->lsndta = fs->lsndir + entsec(fs->dirents);
if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs)))
- return EINVAL;
+ return (EINVAL);
if (fs->lsndta > sc)
- return EINVAL;
+ return (EINVAL);
if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS)
- return EINVAL;
+ return (EINVAL);
fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32;
sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1;
if (fs->xclus > sc)
fs->xclus = sc;
- return 0;
+ return (0);
}
/*
@@ -575,17 +575,17 @@
if (!(s = strchr(path, '/')))
s = strchr(path, 0);
if ((n = s - path) > 255)
- return ENAMETOOLONG;
+ return (ENAMETOOLONG);
memcpy(name, path, n);
name[n] = 0;
path = s;
if (!(de->attr & FA_DIR))
- return ENOTDIR;
+ return (ENOTDIR);
if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de)))
- return err;
+ return (err);
}
*dep = de;
- return 0;
+ return (0);
}
/*
@@ -604,7 +604,7 @@
for (ent = 0; ent < 2; ent++)
if (!strcasecmp(name, dotstr[ent])) {
*dep = dot + ent;
- return 0;
+ return (0);
}
if (!clus && fs->fatsz == 32)
clus = fs->rdcl;
@@ -617,13 +617,13 @@
else if (okclus(fs, clus))
lsec = blklsn(fs, clus);
else
- return EINVAL;
+ return (EINVAL);
for (sec = 0; sec < nsec; sec++) {
if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1))))
- return err;
+ return (err);
for (ent = 0; ent < DEPSEC; ent++) {
if (!*dir[ent].de.name)
- return ENOENT;
+ return (ENOENT);
if (*dir[ent].de.name != 0xe5) {
if ((dir[ent].de.attr & FA_MASK) == FA_XDE) {
x = dir[ent].xde.seq;
@@ -651,7 +651,7 @@
}
if (ok) {
*dep = &dir[ent].de;
- return 0;
+ return (0);
}
}
}
@@ -661,11 +661,11 @@
if (!clus)
break;
if ((err = fatget(fs, &clus)))
- return err;
+ return (err);
if (fatend(fs->fatsz, clus))
break;
}
- return ENOENT;
+ return (ENOENT);
}
/*
@@ -739,11 +739,11 @@
size = fs->dirents * sizeof(DOS_DE);
else {
if ((n = fatcnt(fs, c)) == -1)
- return n;
+ return (n);
size = blkbyt(fs, n);
}
}
- return size;
+ return (size);
}
/*
@@ -756,8 +756,8 @@
for (n = 0; okclus(fs, c); n++)
if (fatget(fs, &c))
- return -1;
- return fatend(fs->fatsz, c) ? n : -1;
+ return (-1);
+ return (fatend(fs->fatsz, c) ? n : -1);
}
/*
@@ -815,7 +815,7 @@
static int
fatend(u_int sz, u_int c)
{
- return c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7);
+ return (c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7));
}
/*
@@ -834,7 +834,7 @@
if ((n = SECSIZ - off) > nbyte)
n = nbyte;
if ((err = ioget(fs->fd, bytsec(offset), off, s, n)))
- return err;
+ return (err);
offset += SECSIZ;
s += n;
nbyte -= n;
@@ -842,15 +842,15 @@
n = nbyte & (SECSIZ - 1);
if (nbyte -= n) {
if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte)))
- return err;
+ return (err);
offset += nbyte;
s += nbyte;
}
if (n) {
if ((err = ioget(fs->fd, bytsec(offset), 0, s, n)))
- return err;
+ return (err);
}
- return 0;
+ return (0);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 7:43 AM (3 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32563106
Default Alt Text
D8678.diff (7 KB)
Attached To
Mode
D8678: libstand: dosfs cstyle cleanup for return keyword.
Attached
Detach File
Event Timeline
Log In to Comment