summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2012-10-11 07:39:51 +0000
committerstefanf <stefanf@FreeBSD.org>2012-10-11 07:39:51 +0000
commit1ae38f4b7e17061a85721eef3680d89b8ecb16f4 (patch)
treeb824c823554e1c327341a12c2ecebce2ee2da0e8
parent6572982b100fc1e39d1d1bd17fd80b681b90cc42 (diff)
downloadFreeBSD-src-1ae38f4b7e17061a85721eef3680d89b8ecb16f4.zip
FreeBSD-src-1ae38f4b7e17061a85721eef3680d89b8ecb16f4.tar.gz
Apply some style. Checked with md5.
-rw-r--r--lib/libc/gen/fstab.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 882c57f..356b871 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -76,7 +76,7 @@ setfstab(const char *file)
}
const char *
-getfstab (void)
+getfstab(void)
{
if (fsp_set)
@@ -86,7 +86,7 @@ getfstab (void)
}
static void
-fixfsfile()
+fixfsfile(void)
{
static char buf[sizeof(_PATH_DEV) + MNAMELEN];
struct stat sb;
@@ -108,7 +108,7 @@ fixfsfile()
}
static int
-fstabscan()
+fstabscan(void)
{
char *cp, *p;
#define MAXLINELENGTH 1024
@@ -119,7 +119,7 @@ fstabscan()
for (;;) {
if (!(p = fgets(line, sizeof(line), _fs_fp)))
- return(0);
+ return (0);
/* OLD_STYLE_FSTAB */
++LineNo;
if (*line == '#' || *line == '\n')
@@ -140,7 +140,7 @@ fstabscan()
_fs_fstab.fs_freq = atoi(cp);
if ((cp = strsep(&p, ":\n")) != NULL) {
_fs_fstab.fs_passno = atoi(cp);
- return(1);
+ return (1);
}
}
}
@@ -206,7 +206,7 @@ fstabscan()
if (typexx)
continue;
if (cp != NULL)
- return(1);
+ return (1);
bad: /* no way to distinguish between EOF and syntax error */
error(EFTYPE);
@@ -215,44 +215,45 @@ bad: /* no way to distinguish between EOF and syntax error */
}
struct fstab *
-getfsent()
+getfsent(void)
{
+
if ((!_fs_fp && !setfsent()) || !fstabscan())
- return((struct fstab *)NULL);
- return(&_fs_fstab);
+ return (NULL);
+ return (&_fs_fstab);
}
struct fstab *
-getfsspec(name)
- const char *name;
+getfsspec(const char *name)
{
+
if (setfsent())
while (fstabscan())
if (!strcmp(_fs_fstab.fs_spec, name))
- return(&_fs_fstab);
- return((struct fstab *)NULL);
+ return (&_fs_fstab);
+ return (NULL);
}
struct fstab *
-getfsfile(name)
- const char *name;
+getfsfile(const char *name)
{
+
if (setfsent())
while (fstabscan())
if (!strcmp(_fs_fstab.fs_file, name))
- return(&_fs_fstab);
- return((struct fstab *)NULL);
+ return (&_fs_fstab);
+ return (NULL);
}
-int
-setfsent()
+int
+setfsent(void)
{
int fd;
if (_fs_fp) {
rewind(_fs_fp);
LineNo = 0;
- return(1);
+ return (1);
}
if (fsp_set == 0) {
if (issetugid())
@@ -268,16 +269,17 @@ setfsent()
_fs_fp = fdopen(fd, "r");
if (_fs_fp != NULL) {
LineNo = 0;
- return(1);
+ return (1);
}
error(errno);
_close(fd);
- return(0);
+ return (0);
}
void
-endfsent()
+endfsent(void)
{
+
if (_fs_fp) {
(void)fclose(_fs_fp);
_fs_fp = NULL;
@@ -287,8 +289,7 @@ endfsent()
}
static void
-error(err)
- int err;
+error(int err)
{
char *p;
char num[30];
OpenPOWER on IntegriCloud