Commit 00279d69 authored by Fredrik Fornwall's avatar Fredrik Fornwall Committed by Jaromir Capik

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
parent 5d818a7a
......@@ -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);
......
......@@ -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;
......
#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
......
......@@ -38,7 +38,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/dir.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <termios.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment