Undigestifier patch, comments (Re: (1272) undigestifier)

By Bart Massey ·

TML message #1274From bundle 105Read the whole thread (2 messages)

In reply to #1272 undigestifier by Ted Kim (Random Dude Cites: #1272
Sorry I didn't respond sooner, but I assumed others would e-mail you.
My *strong* recommendation is to use mh-mail.  Its "burst" command
does exactly what you want -- try 'burst -inplace -verbose'.

Below is a patch to the posted undigestifier for older Berkeley
systems which don't have mkstemp() .  Note that this generates
a race condition, but since the result of mkstemp() wasn't being
checked anyhow...

Also note that the define for END_MARKER needs to be changed for
those of you receiving the bi-weekly digests -- otherwise the code
loops forever consuming disk...

					Bart Massey
					..[email removed]
					..[email removed]

- ------
*** tml_undigest.c.orig	Thu May  3 12:06:08 1990
- --- tml_undigest.c	Thu May  3 11:45:45 1990
***************
*** 4,9 ****
- --- 4,12 ----
   */

  #include <stdio.h>
+ #ifndef HAS_MKSTEMP
+ #include <sys/file.h>
+ #endif

  extern char *getenv();
  extern void get_line();
***************
*** 53,59 ****
- --- 56,67 ----

      /* open tmp file */
      strcpy(filename, TMP_FILENAME);
+ #ifndef HAS_MKSTEMP
+     mktemp( filename );
+     fd = open( filename, O_CREAT | O_RDWR | O_EXCL, 0644 );
+ #else
      fd = mkstemp(filename);
+ #endif
      fp = fdopen(fd, "w");

      for (;;) {