summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-01-09 01:00:04 +0000
committerRoland McGrath <roland@gnu.org>1994-01-09 01:00:04 +0000
commitd2888085550fd9a41c4ac416ddda357c2209d3e5 (patch)
tree09a88078f7d24c43b780320ad669b52acbd818ec /lib-src
parentb0c77c5895800c5cd537adf9a87c5fef637b1d33 (diff)
downloademacs-d2888085550fd9a41c4ac416ddda357c2209d3e5.tar.gz
[! HAVE_STRERROR] (strerror): Define the function.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/movemail.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 0b4163e0234..67dca3ad6a9 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -303,13 +303,15 @@ main (argc, argv)
#endif
#ifndef MAIL_USE_FLOCK
- /* Delete the input file; if we can't, at least get rid of its contents. */
+ /* Delete the input file; if we can't, at least get rid of its
+ contents. */
#ifdef MAIL_UNLINK_SPOOL
/* This is generally bad to do, because it destroys the permissions
that were set on the file. Better to just empty the file. */
if (unlink (inname) < 0 && errno != ENOENT)
#endif /* MAIL_UNLINK_SPOOL */
creat (inname, 0600);
+#endif /* not MAIL_USE_FLOCK */
exit (0);
}
@@ -320,10 +322,9 @@ main (argc, argv)
else if (WRETCODE (status) != 0)
exit (WRETCODE (status));
-#ifndef MAIL_USE_MMDF
+#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_FLOCK)
unlink (lockname);
-#endif /* not MAIL_USE_MMDF */
-#endif /* not MAIL_USE_FLOCK */
+#endif /* not MAIL_USE_MMDF and not MAIL_USE_FLOCK */
exit (0);
}
@@ -769,3 +770,18 @@ mbx_delimit_end (mbf)
}
#endif /* MAIL_USE_POP */
+
+#ifndef HAVE_STRERROR
+char *
+strerror (errnum)
+ int errnum;
+{
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+
+ if (errnum >= 0 && errnum < sys_nerr)
+ return sys_errlist[errnum];
+ return (char *) "Unknown error";
+}
+
+#endif /* ! HAVE_STRERROR */