=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/m4/Attic/serv.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/m4/Attic/serv.c 1996/07/01 20:40:29 1.4 --- src/usr.bin/m4/Attic/serv.c 1996/09/15 19:05:09 1.5 *************** *** 1,4 **** ! /* $OpenBSD: serv.c,v 1.4 1996/07/01 20:40:29 deraadt Exp $ */ /* $NetBSD: serv.c,v 1.7 1995/09/28 05:37:47 tls Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: serv.c,v 1.5 1996/09/15 19:05:09 millert Exp $ */ /* $NetBSD: serv.c,v 1.7 1995/09/28 05:37:47 tls Exp $ */ /* *************** *** 46,52 **** #if 0 static char sccsid[] = "@(#)serv.c 5.4 (Berkeley) 1/21/94"; #else ! static char rcsid[] = "$OpenBSD: serv.c,v 1.4 1996/07/01 20:40:29 deraadt Exp $"; #endif #endif /* not lint */ --- 46,52 ---- #if 0 static char sccsid[] = "@(#)serv.c 5.4 (Berkeley) 1/21/94"; #else ! static char rcsid[] = "$OpenBSD: serv.c,v 1.5 1996/09/15 19:05:09 millert Exp $"; #endif #endif /* not lint */ *************** *** 59,64 **** --- 59,65 ---- #include #include #include + #include #include "mdef.h" #include "extr.h" #include "pathnames.h" *************** *** 337,347 **** dodiv(n) register int n; { if (n < 0 || n >= MAXOUT) n = 0; /* bitbucket */ if (outfile[n] == NULL) { m4temp[UNIQUE] = n + '0'; ! if ((outfile[n] = fopen(m4temp, "w")) == NULL) error("m4: cannot divert."); } oindex = n; --- 338,351 ---- dodiv(n) register int n; { + int fd; + if (n < 0 || n >= MAXOUT) n = 0; /* bitbucket */ if (outfile[n] == NULL) { m4temp[UNIQUE] = n + '0'; ! if ((fd = open(m4temp, O_CREAT|O_EXCL|O_WRONLY, 0600)) < 0 || ! (outfile[n] = fdopen(fd, "w")) == NULL) error("m4: cannot divert."); } oindex = n;