* lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from

Fileutils 4.1.5.
* configure.in: Invoke UTILS_FUNC_MKSTEMP.
* src/output.c (output_skeleton): Use mkstemp to create a real
temporary file.
Move the filling of `skeleton' and its muscle to...
(prepare): here.
(output): Move the definition of the prologue muscle to...
(prepare): here.
* src/system.h (DEFAULT_TMPDIR): New.
This commit is contained in:
Akim Demaille
2002-02-25 13:44:43 +00:00
parent 10b6b2be55
commit 381fb12e1e
8 changed files with 530 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/* system-dependent definitions for Bison.
Copyright 2000, 2001 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -249,7 +249,9 @@ do { \
#define BITISSET(x, i) (((x)[(i)/BITS_PER_WORD] & (1<<((i) % BITS_PER_WORD))) != 0)
/* Extensions to use for the output files. */
/*-----------------------------------------.
| Extensions to use for the output files. |
`-----------------------------------------*/
#ifdef VMS
/* VMS. */
@@ -273,11 +275,23 @@ do { \
# endif /* ! MSDOS */
#endif /* ! VMS */
/* As memcpy, but for shorts. */
#ifndef DEFAULT_TMPDIR
# define DEFAULT_TMPDIR "/tmp"
#endif
/*----------------------------.
| As memcpy, but for shorts. |
`----------------------------*/
#define shortcpy(Dest, Src, Num) \
memcpy (Dest, Src, Num * sizeof (short))
/* Free a linked list. */
/*---------------------.
| Free a linked list. |
`---------------------*/
#define LIST_FREE(Type, List) \
do { \
Type *_node, *_next; \
@@ -288,9 +302,10 @@ do { \
} \
} while (0)
/*---------------------------------.
| Debugging the memory allocator. |
`---------------------------------*/
/*---------------------------------------------.
| Debugging memory allocation (must be last). |
`---------------------------------------------*/
# if WITH_DMALLOC
# define DMALLOC_FUNC_CHECK