aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorDavid J. MacKenzie1992-03-09 17:40:11 +0000
committerDavid J. MacKenzie1992-03-09 17:40:11 +0000
commite97dd18354d2d6bd1b37733e54ebbb82895058fd (patch)
tree2b7faab40ac623540bf7429012b38092a5bf52f4 /lib-src
parentee04dc54f4e86c57e64312ae5b0b48b260fbf781 (diff)
downloademacs-e97dd18354d2d6bd1b37733e54ebbb82895058fd.tar.gz
emacs-e97dd18354d2d6bd1b37733e54ebbb82895058fd.zip
*** empty log message ***
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/movemail.c19
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 ();
80#undef write 80#undef write
81#undef close 81#undef close
82 82
83char *malloc ();
83char *concat (); 84char *concat ();
85char *xmalloc ();
86#ifndef errno
84extern int errno; 87extern int errno;
88#endif
85 89
86/* Nonzero means this is name of a lock file to delete on fatal error. */ 90/* Nonzero means this is name of a lock file to delete on fatal error. */
87char *delete_lockname; 91char *delete_lockname;
@@ -284,9 +288,12 @@ main (argc, argv)
284 288
285#ifndef MAIL_USE_FLOCK 289#ifndef MAIL_USE_FLOCK
286 /* Delete the input file; if we can't, at least get rid of its contents. */ 290 /* Delete the input file; if we can't, at least get rid of its contents. */
287 if (unlink (inname) < 0) 291#ifdef MAIL_UNLINK_SPOOL
288 if (errno != ENOENT) 292 /* This is generally bad to do, because it destroys the permissions
289 creat (inname, 0666); 293 that were set on the file. Better to just empty the file. */
294 if (unlink (inname) < 0 && errno != ENOENT)
295#endif /* MAIL_UNLINK_SPOOL */
296 creat (inname, 0600);
290#ifndef MAIL_USE_MMDF 297#ifndef MAIL_USE_MMDF
291 unlink (lockname); 298 unlink (lockname);
292#endif /* not MAIL_USE_MMDF */ 299#endif /* not MAIL_USE_MMDF */
@@ -364,11 +371,11 @@ concat (s1, s2, s3)
364 371
365/* Like malloc but get fatal error if memory is exhausted. */ 372/* Like malloc but get fatal error if memory is exhausted. */
366 373
367int 374char *
368xmalloc (size) 375xmalloc (size)
369 int size; 376 unsigned size;
370{ 377{
371 int result = malloc (size); 378 char *result = malloc (size);
372 if (!result) 379 if (!result)
373 fatal ("virtual memory exhausted", 0); 380 fatal ("virtual memory exhausted", 0);
374 return result; 381 return result;