pkgsrc/misc/xtail/patches/patch-ab

42 lines
1.1 KiB
Text

$NetBSD: patch-ab,v 1.2 2006/01/03 15:56:54 joerg Exp $
--- miscfuncs.c.orig 2000-06-05 07:13:22.000000000 +0000
+++ miscfuncs.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
+#include <limits.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
@@ -65,7 +66,11 @@ int scan_directory(const char *dirname)
char *basename;
struct stat sbuf;
DIR *dirp;
+#ifdef NAME_MAX
+ static char pathname[NAME_MAX];
+#else
static char pathname[MAXNAMLEN];
+#endif
Dprintf(stderr, ">>> scanning directory '%s'\n", dirname);
if ((dirp = opendir(dirname)) == NULL)
@@ -281,7 +286,7 @@ VOID *safe_malloc(size_t n)
{
VOID *p;
if ((p = malloc(n)) == NULL) {
- fprintf(stderr, "%s: malloc(%d) failed\n", Progname, n);
+ fprintf(stderr, "%s: malloc(%ld) failed\n", Progname, (long)n);
exit(2);
}
return p;
@@ -291,7 +296,7 @@ VOID *safe_realloc(VOID *p, size_t n)
{
VOID *p1;
if ((p1 = realloc(p, n)) == NULL) {
- fprintf(stderr, "%s: realloc(%d) failed\n", Progname, n);
+ fprintf(stderr, "%s: realloc(%ld) failed\n", Progname, (long)n);
exit(2);
}
return p1;