From: Sascha Wildner Date: Mon, 5 Jan 2015 09:38:31 +0000 (+0100) Subject: Use the dirfd() macro instead of accessing struct _dirdesc directly. X-Git-Tag: v4.2.0rc~1188 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/bfdd8ef338ec9ca3353291972ec7c945ede19eba Use the dirfd() macro instead of accessing struct _dirdesc directly. This is in preparation for making dirfd() a function (for POSIX conformance) and struct _dirdesc private. --- diff --git a/usr.bin/rdist/expand.c b/usr.bin/rdist/expand.c index 1fe6e04224..366f73f771 100644 --- a/usr.bin/rdist/expand.c +++ b/usr.bin/rdist/expand.c @@ -293,7 +293,7 @@ matchdir(char *pattern) return; goto patherr2; } - if (fstat(dirp->dd_fd, &stb) < 0) + if (fstat(dirfd(dirp), &stb) < 0) goto patherr1; if (!ISDIR(stb.st_mode)) { errno = ENOTDIR; diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 7c371aed0b..4adea63ebf 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -116,7 +116,7 @@ getq(const struct printer *pp, struct jobqueue *(*namelist[])) seteuid(uid); return (-1); } - if (fstat(dirp->dd_fd, &stbuf) < 0) + if (fstat(dirfd(dirp), &stbuf) < 0) goto errdone; seteuid(uid);