Skip to content
Snippets Groups Projects
Commit 5a55cece authored by Moe Jette's avatar Moe Jette
Browse files

Eliminate reference to NAME_MAX, not available on AIX.

parent b66ca4aa
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ typedef struct xppid_s { ...@@ -53,6 +53,7 @@ typedef struct xppid_s {
struct xppid_s *next; struct xppid_s *next;
} xppid_t; } xppid_t;
#define MAX_NAME_LEN 64
#define HASH_LEN 64 #define HASH_LEN 64
static xppid_t **hashtbl; static xppid_t **hashtbl;
...@@ -103,7 +104,7 @@ static void _build_hashtbl() ...@@ -103,7 +104,7 @@ static void _build_hashtbl()
{ {
DIR *dir; DIR *dir;
struct dirent *de; struct dirent *de;
char path[NAME_MAX], *endptr, *num, rbuf[1024]; char path[MAX_NAME_LEN], *endptr, *num, rbuf[1024];
int fd; int fd;
long pid, ppid; long pid, ppid;
...@@ -119,7 +120,7 @@ static void _build_hashtbl() ...@@ -119,7 +120,7 @@ static void _build_hashtbl()
strtol(num, &endptr, 10); strtol(num, &endptr, 10);
if (endptr == NULL || *endptr != 0) if (endptr == NULL || *endptr != 0)
continue; continue;
sprintf(path, "/proc/%s/stat", num); snprintf(path, MAX_NAME_LEN, "/proc/%s/stat", num);
if ((fd = open(path, O_RDONLY)) < 0) { if ((fd = open(path, O_RDONLY)) < 0) {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment