Mercurial > emacs
changeset 571:3dfecf91a09b
*** empty log message ***
author | David J. MacKenzie <djm@gnu.org> |
---|---|
date | Mon, 09 Mar 1992 17:40:11 +0000 |
parents | c5bfe6e87d93 |
children | 0c2e4ee42304 |
files | lib-src/movemail.c |
diffstat | 1 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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;