comparison lib-src/movemail.c @ 5532:9c86c71e879d

[! HAVE_STRERROR] (strerror): Define the function.
author Roland McGrath <roland@gnu.org>
date Sun, 09 Jan 1994 01:00:04 +0000
parents f14a0fe979d9
children a1a42eefcc61
comparison
equal deleted inserted replaced
5531:c4f36c5ece61 5532:9c86c71e879d
301 #else 301 #else
302 close (indesc); 302 close (indesc);
303 #endif 303 #endif
304 304
305 #ifndef MAIL_USE_FLOCK 305 #ifndef MAIL_USE_FLOCK
306 /* Delete the input file; if we can't, at least get rid of its contents. */ 306 /* Delete the input file; if we can't, at least get rid of its
307 contents. */
307 #ifdef MAIL_UNLINK_SPOOL 308 #ifdef MAIL_UNLINK_SPOOL
308 /* This is generally bad to do, because it destroys the permissions 309 /* This is generally bad to do, because it destroys the permissions
309 that were set on the file. Better to just empty the file. */ 310 that were set on the file. Better to just empty the file. */
310 if (unlink (inname) < 0 && errno != ENOENT) 311 if (unlink (inname) < 0 && errno != ENOENT)
311 #endif /* MAIL_UNLINK_SPOOL */ 312 #endif /* MAIL_UNLINK_SPOOL */
312 creat (inname, 0600); 313 creat (inname, 0600);
314 #endif /* not MAIL_USE_FLOCK */
313 315
314 exit (0); 316 exit (0);
315 } 317 }
316 318
317 wait (&status); 319 wait (&status);
318 if (!WIFEXITED (status)) 320 if (!WIFEXITED (status))
319 exit (1); 321 exit (1);
320 else if (WRETCODE (status) != 0) 322 else if (WRETCODE (status) != 0)
321 exit (WRETCODE (status)); 323 exit (WRETCODE (status));
322 324
323 #ifndef MAIL_USE_MMDF 325 #if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_FLOCK)
324 unlink (lockname); 326 unlink (lockname);
325 #endif /* not MAIL_USE_MMDF */ 327 #endif /* not MAIL_USE_MMDF and not MAIL_USE_FLOCK */
326 #endif /* not MAIL_USE_FLOCK */
327 exit (0); 328 exit (0);
328 } 329 }
329 330
330 /* Print error message and exit. */ 331 /* Print error message and exit. */
331 332
767 { 768 {
768 putc ('\037', mbf); 769 putc ('\037', mbf);
769 } 770 }
770 771
771 #endif /* MAIL_USE_POP */ 772 #endif /* MAIL_USE_POP */
773
774 #ifndef HAVE_STRERROR
775 char *
776 strerror (errnum)
777 int errnum;
778 {
779 extern char *sys_errlist[];
780 extern int sys_nerr;
781
782 if (errnum >= 0 && errnum < sys_nerr)
783 return sys_errlist[errnum];
784 return (char *) "Unknown error";
785 }
786
787 #endif /* ! HAVE_STRERROR */