# HG changeset patch # User David J. MacKenzie # Date 700162811 0 # Node ID 3dfecf91a09b525b587e04241c13ee006118d7a7 # Parent c5bfe6e87d93fdd4d53a22434aba210020108766 *** empty log message *** diff -r c5bfe6e87d93 -r 3dfecf91a09b lib-src/movemail.c --- a/lib-src/movemail.c Fri Mar 06 23:46:21 1992 +0000 +++ b/lib-src/movemail.c Mon Mar 09 17:40:11 1992 +0000 @@ -80,8 +80,12 @@ #undef write #undef close +char *malloc (); char *concat (); +char *xmalloc (); +#ifndef errno extern int errno; +#endif /* Nonzero means this is name of a lock file to delete on fatal error. */ char *delete_lockname; @@ -284,9 +288,12 @@ #ifndef MAIL_USE_FLOCK /* Delete the input file; if we can't, at least get rid of its contents. */ - if (unlink (inname) < 0) - if (errno != ENOENT) - creat (inname, 0666); +#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); #ifndef MAIL_USE_MMDF unlink (lockname); #endif /* not MAIL_USE_MMDF */ @@ -364,11 +371,11 @@ /* Like malloc but get fatal error if memory is exhausted. */ -int +char * xmalloc (size) - int size; + unsigned size; { - int result = malloc (size); + char *result = malloc (size); if (!result) fatal ("virtual memory exhausted", 0); return result;