tolerate IA-64 headers w/o PAGE_SIZE
This commit is contained in:
@ -19,10 +19,10 @@
|
||||
#include "version.h"
|
||||
#include "devname.h"
|
||||
|
||||
#include <asm/page.h>
|
||||
#ifndef PAGE_SIZE
|
||||
#define PAGE_SIZE (sizeof(long)*1024)
|
||||
#endif
|
||||
// This is the buffer size for a tty name. Any path is legal,
|
||||
// which makes PAGE_SIZE appropriate (see kernel source), but
|
||||
// that is only 99% portable and utmp only holds 32 anyway.
|
||||
#define NAME_SIZE 128
|
||||
|
||||
/* Who uses what:
|
||||
*
|
||||
@ -216,7 +216,7 @@ static int link_name(char *restrict const buf, unsigned maj, unsigned min, int p
|
||||
char path[32];
|
||||
int count;
|
||||
sprintf(path, "/proc/%d/%s", pid, name); /* often permission denied */
|
||||
count = readlink(path,buf,PAGE_SIZE-1);
|
||||
count = readlink(path,buf,NAME_SIZE-1);
|
||||
if(count == -1) return 0;
|
||||
buf[count] = '\0';
|
||||
if(stat(buf, &sbuf) < 0) return 0;
|
||||
@ -227,7 +227,7 @@ static int link_name(char *restrict const buf, unsigned maj, unsigned min, int p
|
||||
|
||||
/* number --> name */
|
||||
unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags) {
|
||||
static char buf[PAGE_SIZE];
|
||||
static char buf[NAME_SIZE];
|
||||
char *restrict tmp = buf;
|
||||
unsigned dev = dev_t_dev;
|
||||
unsigned i = 0;
|
||||
|
Reference in New Issue
Block a user