aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/ChangeLog4
-rw-r--r--util/errors.c15
-rw-r--r--util/iobuf.c1
3 files changed, 20 insertions, 0 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index 31312c7eb..23d284b1a 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,7 @@
+Fri May 8 17:06:49 1998 Werner Koch ([email protected])
+
+ * errors.c (strerror): New if !HAVE_STRERROR
+
Mon May 4 19:48:03 1998 Werner Koch ([email protected])
* iobuf.c (iobuf_read): Code is now faster.
diff --git a/util/errors.c b/util/errors.c
index 4436e78c0..b71ff4f49 100644
--- a/util/errors.c
+++ b/util/errors.c
@@ -25,6 +25,21 @@
#include "errors.h"
+#ifndef HAVE_STRERROR
+char *
+strerror( int n )
+{
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ static char buf[15];
+
+ if( n >= 0 && n < sys_nerr )
+ return sys_errlist[n];
+ strcpy( buf, "Unknown error" );
+ return buf;
+}
+#endif /* !HAVE_STRERROR */
+
const char *
g10_errstr( int err )
{
diff --git a/util/iobuf.c b/util/iobuf.c
index 1578d565b..d43fad9ba 100644
--- a/util/iobuf.c
+++ b/util/iobuf.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>