diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/movemail.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 9b216068357..235f8c43420 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -80,8 +80,12 @@ extern int lk_open (), lk_close (); #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 @@ main (argc, argv) #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 @@ concat (s1, s2, s3) /* 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; |
