mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-04 02:08:49 -04:00
31 lines
708 B
Plaintext
31 lines
708 B
Plaintext
$NetBSD: patch-ac,v 1.3 2014/09/23 14:29:50 jperkin Exp $
|
|
|
|
--- libpnmrw.c.orig 1995-08-16 22:24:26.000000000 +0000
|
|
+++ libpnmrw.c
|
|
@@ -28,6 +28,7 @@
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
+#include <errno.h>
|
|
#include "libpnmrw.h"
|
|
|
|
/* if don't have string.h, try strings.h */
|
|
@@ -126,11 +127,16 @@ static void
|
|
pm_perror( reason )
|
|
char* reason;
|
|
{
|
|
+#if !defined(__NetBSD__) && !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__sun)
|
|
extern char* sys_errlist[];
|
|
- extern int errno;
|
|
+#endif
|
|
char* e;
|
|
|
|
+#ifdef __sun
|
|
+ e = strerror(errno);
|
|
+#else
|
|
e = sys_errlist[errno];
|
|
+#endif
|
|
|
|
if ( reason != 0 && reason[0] != '\0' )
|
|
(void) fprintf( stderr, "%s: %s - %s\n", progname, reason, e );
|