summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-03-19 00:30:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-03-19 00:30:11 +0000
commit5643391d32d8965e97def2dc4d0e58bb24060bc0 (patch)
treeb20a3fb1d2e6123a59938792d862e7b5c5ef5e59 /lib/libc/gen
parent8aee2c24aa2e8e4e5f36756d400b1fa2a0499ab3 (diff)
some -Wall
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/fnmatch.c8
-rw-r--r--lib/libc/gen/fts.c14
-rw-r--r--lib/libc/gen/getcap.c6
-rw-r--r--lib/libc/gen/syslog.c5
4 files changed, 18 insertions, 15 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index 5063ff36a44..acb6047b7fd 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fnmatch.c,v 1.5 1997/09/22 05:03:30 millert Exp $ */
+/* $OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.5 1997/09/22 05:03:30 millert Exp $";
+static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -100,14 +100,14 @@ fnmatch(pattern, string, flags)
return (FNM_NOMATCH);
/* Optimize for pattern with * at end or before /. */
- if (c == EOS)
+ if (c == EOS) {
if (flags & FNM_PATHNAME)
return ((flags & FNM_LEADING_DIR) ||
strchr(string, '/') == NULL ?
0 : FNM_NOMATCH);
else
return (0);
- else if (c == '/' && (flags & FNM_PATHNAME)) {
+ } else if (c == '/' && (flags & FNM_PATHNAME)) {
if ((string = strchr(string, '/')) == NULL)
return (FNM_NOMATCH);
break;
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 161853fc24c..f221f986959 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.14 1997/10/11 04:04:40 millert Exp $ */
+/* $OpenBSD: fts.c,v 1.15 1998/03/19 00:30:01 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-static char rcsid[] = "$OpenBSD: fts.c,v 1.14 1997/10/11 04:04:40 millert Exp $";
+static char rcsid[] = "$OpenBSD: fts.c,v 1.15 1998/03/19 00:30:01 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -299,12 +299,13 @@ fts_read(sp)
if (instr == FTS_FOLLOW &&
(p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
p->fts_info = fts_stat(sp, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
+ }
return (p);
}
@@ -394,13 +395,14 @@ next: tmp = p;
goto next;
if (p->fts_instr == FTS_FOLLOW) {
p->fts_info = fts_stat(sp, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd =
open(".", O_RDONLY, 0)) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
+ }
p->fts_instr = FTS_NOINSTR;
}
@@ -641,7 +643,7 @@ fts_build(sp, type)
* checking FTS_NS on the returned nodes.
*/
cderrno = 0;
- if (nlinks || type == BREAD)
+ if (nlinks || type == BREAD) {
if (fts_safe_changedir(sp, cur, dirfd(dirp))) {
if (nlinks && type == BREAD)
cur->fts_errno = errno;
@@ -652,7 +654,7 @@ fts_build(sp, type)
dirp = NULL;
} else
descend = 1;
- else
+ } else
descend = 0;
/*
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 98e7c14acef..75013d7c3f9 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getcap.c,v 1.12 1998/03/17 23:28:58 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: getcap.c,v 1.13 1998/03/19 00:30:02 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -593,12 +593,12 @@ cgetmatch(buf, name)
*/
np = name;
for (;;)
- if (*np == '\0')
+ if (*np == '\0') {
if (*bp == '|' || *bp == ':' || *bp == '\0')
return (0);
else
break;
- else
+ } else
if (*bp++ != *np++)
break;
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index c6e3e34b1b2..d1bb6af360e 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: syslog.c,v 1.7 1998/03/06 02:01:38 brian Exp $";
+static char rcsid[] = "$OpenBSD: syslog.c,v 1.8 1998/03/19 00:30:03 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -262,13 +262,14 @@ openlog(ident, logstat, logfac)
(void)fcntl(LogFile, F_SETFD, 1);
}
}
- if (LogFile != -1 && !connected)
+ if (LogFile != -1 && !connected) {
if (connect(LogFile, (struct sockaddr *)&SyslogAddr,
sizeof(SyslogAddr)) == -1) {
(void)close(LogFile);
LogFile = -1;
} else
connected = 1;
+ }
}
void