From 34db19b97357d7024ca189bd6d251466d6858e0c Mon Sep 17 00:00:00 2001 From: ru Date: Wed, 30 Nov 2005 17:55:49 +0000 Subject: [PATCH] Style: use S_ISDIR() (submitted by bde@) and eq() where appropriate. --- usr.sbin/config/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index 0ab79c3f4c6..e7f270e8e38 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; } -- 2.45.2