summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/main.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-30 17:55:49 +0000
committerru <ru@FreeBSD.org>2005-11-30 17:55:49 +0000
commit34db19b97357d7024ca189bd6d251466d6858e0c (patch)
treea254ba9e2324bf0c2ffe78a5cd1ad6dbc20ecfd2 /usr.sbin/config/main.c
parent472f9c43343fbf7d7524136d738cb65846ba61c0 (diff)
downloadFreeBSD-src-34db19b97357d7024ca189bd6d251466d6858e0c.zip
FreeBSD-src-34db19b97357d7024ca189bd6d251466d6858e0c.tar.gz
Style: use S_ISDIR() (submitted by bde@) and eq() where appropriate.
Diffstat (limited to 'usr.sbin/config/main.c')
-rw-r--r--usr.sbin/config/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 0ab79c3..e7f270e 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -153,8 +153,7 @@ main(int argc, char **argv)
if (stat(p, &buf)) {
if (mkdir(p, 0777))
err(2, "%s", p);
- }
- else if ((buf.st_mode & S_IFMT) != S_IFDIR)
+ } else if (!S_ISDIR(buf.st_mode))
errx(2, "%s isn't a directory", p);
STAILQ_INIT(&dtab);
@@ -470,7 +469,7 @@ cleanheaders(char *p)
continue;
/* Check if it is a target file */
for (hl = htab; hl != NULL; hl = hl->h_next) {
- if (strcmp(dp->d_name, hl->h_name) == 0) {
+ if (eq(dp->d_name, hl->h_name)) {
break;
}
}
@@ -499,7 +498,7 @@ remember(const char *file)
return;
}
for (hl = htab; hl != NULL; hl = hl->h_next) {
- if (strcmp(s, hl->h_name) == 0) {
+ if (eq(s, hl->h_name)) {
free(s);
return;
}
OpenPOWER on IntegriCloud