openbsd-ports/devel/m4/patches/patch-ac
marc 04ef6b8b7a fix fd leak in patch; remove unneeded patch;
verify package builds correctly
1998-07-25 21:55:41 +00:00

18 lines
448 B
Plaintext

--- src/builtin.c.orig Wed Aug 31 09:45:12 1994
+++ src/builtin.c Sat Jul 25 14:30:35 1998
@@ -1076,9 +1076,13 @@
static void
m4_maketemp (struct obstack *obs, int argc, token_data **argv)
{
+ int fd;
if (bad_argc (argv[0], argc, 2, 2))
return;
- mktemp (ARG (1));
+ fd = mkstemp (ARG (1));
+ if ( fd == -1 )
+ err( 1, "can't create temp file %s", ARG (1) );
+ close( fd );
obstack_grow (obs, ARG (1), strlen (ARG (1)));
}