2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 22:35:10 +00:00

We require POSIX so no need to conditionally include dirent.h.

Add a check for d_namlen and use the result in the NAMLEN macro.
This commit is contained in:
Todd C. Miller
2015-07-02 09:24:48 -06:00
parent 0b241088b3
commit d77941c2be
11 changed files with 124 additions and 202 deletions

View File

@@ -28,22 +28,7 @@
#ifdef HAVE_PSTAT_GETPROC
# include <sys/pstat.h>
#else
# ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
# else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
# endif
# include <dirent.h>
#endif
#include "sudo_compat.h"