fixed temp file creation issues on win32
This commit is contained in:
@@ -45,6 +45,7 @@ SRCS += tblcmp.c
|
||||
SRCS += parse.c
|
||||
|
||||
PROD_HOST = e_flex
|
||||
PROD_LIBS = Com
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ extern int yymore_really_used, reject_really_used;
|
||||
extern int datapos, dataline, linenum;
|
||||
extern FILE *skelfile, *yyin, *temp_action_file, *backtrack_file;
|
||||
extern char *infilename;
|
||||
extern char *action_file_name;
|
||||
extern char action_file_name[];
|
||||
extern char **input_files;
|
||||
extern int num_input_files;
|
||||
extern char *program_name;
|
||||
|
||||
@@ -50,6 +50,8 @@ static char rcsid[] =
|
||||
#include "flexdef.h"
|
||||
*/
|
||||
|
||||
#include "epicsStdio.h"
|
||||
|
||||
static char flex_version[] = "2.3";
|
||||
|
||||
|
||||
@@ -101,7 +103,7 @@ int num_backtracking, bol_needed;
|
||||
FILE *temp_action_file;
|
||||
FILE *backtrack_file;
|
||||
int end_of_buffer_state;
|
||||
char *action_file_name = NULL;
|
||||
char action_file_name[256>L_tmpnam?256:L_tmpnam];
|
||||
char **input_files;
|
||||
int num_input_files;
|
||||
char *program_name;
|
||||
@@ -606,25 +608,13 @@ get_next_arg: /* used by -C and -S flags in lieu of a "continue 2" control */
|
||||
if ( (skelfile = fopen( skelname, "r" )) == NULL )
|
||||
lerrsf( "can't open skeleton file %s", skelname );
|
||||
|
||||
#ifdef SYS_V
|
||||
action_file_name = tmpnam( NULL );
|
||||
#endif
|
||||
epicsTempName ( action_file_name, sizeof ( action_file_name ) );
|
||||
if ( action_file_name[0] == '\0' )
|
||||
{
|
||||
lerrsf( "can't create temporary file name", "" );
|
||||
}
|
||||
|
||||
if ( action_file_name == NULL )
|
||||
{
|
||||
static char temp_action_file_name[32];
|
||||
|
||||
#ifndef SHORT_FILE_NAMES
|
||||
(void) strcpy( temp_action_file_name, "/tmp/flexXXXXXX" );
|
||||
#else
|
||||
(void) strcpy( temp_action_file_name, "flexXXXXXX.tmp" );
|
||||
#endif
|
||||
(void) mktemp( temp_action_file_name );
|
||||
|
||||
action_file_name = temp_action_file_name;
|
||||
}
|
||||
|
||||
if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )
|
||||
if ( ( temp_action_file = fopen ( action_file_name, "w" ) ) == NULL )
|
||||
lerrsf( "can't open temporary action file %s", action_file_name );
|
||||
|
||||
lastdfa = lastnfa = num_rules = numas = numsnpairs = tmpuses = 0;
|
||||
|
||||
Reference in New Issue
Block a user