| 1 | --- src/output.c 5 Jul 2007 03:53:08 -0000 1.1.1.1.2.23 |
| 2 | +++ src/output.c 22 Jul 2007 04:23:17 -0000 |
| 3 | @@ -252,6 +252,11 @@ m4_tmpopen (int divnum) |
| 4 | else if (set_cloexec_flag (fileno (file), true) != 0) |
| 5 | M4ERROR ((warning_status, errno, |
| 6 | "Warning: cannot protect diversion across forks")); |
| 7 | + /* POSIX states that it is undefined whether an append stream starts |
| 8 | + at offset 0 or at the end. We want the beginning. */ |
| 9 | + else if (fseeko (file, 0, SEEK_SET) != 0) |
| 10 | + M4ERROR ((EXIT_FAILURE, errno, |
| 11 | + "cannot seek to beginning of diversion")); |
| 12 | return file; |
| 13 | } |
| 14 | |