summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cpucontrol/cpucontrol.c
diff options
context:
space:
mode:
authorgleb <gleb@FreeBSD.org>2012-05-19 12:44:27 +0000
committergleb <gleb@FreeBSD.org>2012-05-19 12:44:27 +0000
commit53af2dbdcaab2b0af0595c7972b876b8ef9e9ae6 (patch)
tree52b234943a3ae78c62d839ca39a00589e970906a /usr.sbin/cpucontrol/cpucontrol.c
parent9409c11a935c0490bedd5a31b003a34bb8caea1f (diff)
downloadFreeBSD-src-53af2dbdcaab2b0af0595c7972b876b8ef9e9ae6.zip
FreeBSD-src-53af2dbdcaab2b0af0595c7972b876b8ef9e9ae6.tar.gz
Hide DIR definition by making it an opaque struct typedef.
Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011
Diffstat (limited to 'usr.sbin/cpucontrol/cpucontrol.c')
-rw-r--r--usr.sbin/cpucontrol/cpucontrol.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/cpucontrol/cpucontrol.c b/usr.sbin/cpucontrol/cpucontrol.c
index 7477007..8738612 100644
--- a/usr.sbin/cpucontrol/cpucontrol.c
+++ b/usr.sbin/cpucontrol/cpucontrol.c
@@ -292,7 +292,7 @@ do_update(const char *dev)
int error;
struct ucode_handler *handler;
struct datadir *dir;
- DIR *dirfd;
+ DIR *dirp;
struct dirent *direntry;
char buf[MAXPATHLEN];
@@ -321,12 +321,12 @@ do_update(const char *dev)
* Process every image in specified data directories.
*/
SLIST_FOREACH(dir, &datadirs, next) {
- dirfd = opendir(dir->path);
- if (dirfd == NULL) {
+ dirp = opendir(dir->path);
+ if (dirp == NULL) {
WARNX(1, "skipping directory %s: not accessible", dir->path);
continue;
}
- while ((direntry = readdir(dirfd)) != NULL) {
+ while ((direntry = readdir(dirp)) != NULL) {
if (direntry->d_namlen == 0)
continue;
error = snprintf(buf, sizeof(buf), "%s/%s", dir->path,
@@ -340,7 +340,7 @@ do_update(const char *dev)
}
handler->update(dev, buf);
}
- error = closedir(dirfd);
+ error = closedir(dirp);
if (error != 0)
WARN(0, "closedir(%s)", dir->path);
}
OpenPOWER on IntegriCloud