newsyslog(8): Rename a variable (dirfd() is a macro too).
authorSascha Wildner <saw@online.de>
Mon, 5 Jan 2015 09:40:49 +0000 (10:40 +0100)
committerSascha Wildner <saw@online.de>
Mon, 5 Jan 2015 09:40:49 +0000 (10:40 +0100)
usr.sbin/newsyslog/newsyslog.c

index cca5ffb..728f0a8 100644 (file)
@@ -1442,7 +1442,7 @@ static void
 delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir)
 {
        char *logfname, *s, *dir, errbuf[80];
-       int dirfd, i, logcnt, max_logcnt, valid;
+       int dir_fd, i, logcnt, max_logcnt, valid;
        struct oldlog_entry *oldlogs;
        size_t logfname_len;
        struct dirent *dp;
@@ -1476,7 +1476,7 @@ delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir)
        /* First we create a 'list' of all archived logfiles */
        if ((dirp = opendir(dir)) == NULL)
                err(1, "Cannot open log directory '%s'", dir);
-       dirfd = dirfd(dirp);
+       dir_fd = dirfd(dirp);
        while ((dp = readdir(dirp)) != NULL) {
                if (dp->d_type != DT_REG)
                        continue;
@@ -1568,7 +1568,7 @@ delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir)
                        if (noaction)
                                printf("\trm -f %s/%s\n", dir,
                                    oldlogs[i].fname);
-                       else if (unlinkat(dirfd, oldlogs[i].fname, 0) != 0) {
+                       else if (unlinkat(dir_fd, oldlogs[i].fname, 0) != 0) {
                                snprintf(errbuf, sizeof(errbuf),
                                    "Could not delete old logfile '%s'",
                                    oldlogs[i].fname);