diff options
author | Fredrik Fornwall <fredrik@fornwall.net> | 2014-07-06 16:21:01 +0200 |
---|---|---|
committer | Jaromir Capik <jcapik@redhat.com> | 2014-08-26 16:01:57 +0200 |
commit | 00279d692a9a3f32cd33a39190787435a8e21ad0 (patch) | |
tree | aea89427429717ecf6a80456643b8fcdd4382305 /proc | |
parent | 5d818a7a6d4ecb877b1eab74838cdbdcb1781f07 (diff) | |
download | procps-ng-00279d692a9a3f32cd33a39190787435a8e21ad0.tar.gz |
Use <dirent.h> instead of <sys/dir.h>
Using <dirent.h> and struct dirent instead of <sys/dir.h> and struct direct
is preferred and works on Android which lacks sys/dir.h.
See:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
Diffstat (limited to 'proc')
-rw-r--r-- | proc/readproc.c | 6 | ||||
-rw-r--r-- | proc/sysinfo.c | 2 | ||||
-rw-r--r-- | proc/sysinfo.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/proc/readproc.c b/proc/readproc.c index 207c438..9e3afc9 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -34,7 +34,7 @@ #include <unistd.h> #include <signal.h> #include <fcntl.h> -#include <sys/dir.h> +#include <dirent.h> #include <sys/types.h> #include <sys/stat.h> #ifdef WITH_SYSTEMD @@ -1099,7 +1099,7 @@ next_task: // This finds processes in /proc in the traditional way. // Return non-zero on success. static int simple_nextpid(PROCTAB *restrict const PT, proc_t *restrict const p) { - static struct direct *ent; /* dirent handle */ + static struct dirent *ent; /* dirent handle */ char *restrict const path = PT->path; for (;;) { ent = readdir(PT->procfs); @@ -1117,7 +1117,7 @@ static int simple_nextpid(PROCTAB *restrict const PT, proc_t *restrict const p) // This finds tasks in /proc/*/task/ in the traditional way. // Return non-zero on success. static int simple_nexttid(PROCTAB *restrict const PT, const proc_t *restrict const p, proc_t *restrict const t, char *restrict const path) { - static struct direct *ent; /* dirent handle */ + static struct dirent *ent; /* dirent handle */ if(PT->taskdir_user != p->tgid){ if(PT->taskdir){ closedir(PT->taskdir); diff --git a/proc/sysinfo.c b/proc/sysinfo.c index 1876980..ee286f2 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -399,7 +399,7 @@ static void crash(const char *filename) { /***********************************************************************/ static void getrunners(unsigned int *restrict running, unsigned int *restrict blocked) { - struct direct *ent; + struct dirent *ent; DIR *proc; *running=0; diff --git a/proc/sysinfo.h b/proc/sysinfo.h index adb0519..1464cb9 100644 --- a/proc/sysinfo.h +++ b/proc/sysinfo.h @@ -1,7 +1,7 @@ #ifndef PROC_SYSINFO_H #define PROC_SYSINFO_H #include <sys/types.h> -#include <sys/dir.h> +#include <dirent.h> #include "procps.h" EXTERN_C_BEGIN |