Lines 702-707
Link Here
|
702 |
|
702 |
|
703 |
while( --tries ) |
703 |
while( --tries ) |
704 |
{ |
704 |
{ |
|
|
705 |
/* This sets path to the name of the created temp file. */ |
705 |
if( (fd = Create_temp(tmpdir, path)) != -1) |
706 |
if( (fd = Create_temp(tmpdir, path)) != -1) |
706 |
break; |
707 |
break; |
707 |
|
708 |
|
Lines 710-716
Link Here
|
710 |
|
711 |
|
711 |
if( fd != -1) |
712 |
if( fd != -1) |
712 |
{ |
713 |
{ |
713 |
Def_macro( "TMPFILE", *path, M_MULTI|M_EXPANDED ); |
714 |
Def_macro( "TMPFILE", DO_WINPATH(*path), M_MULTI|M_EXPANDED ); |
714 |
/* associate stream with file descriptor */ |
715 |
/* associate stream with file descriptor */ |
715 |
fp = fdopen(fd, mode); |
716 |
fp = fdopen(fd, mode); |
716 |
} |
717 |
} |
Lines 746-751
Link Here
|
746 |
|
747 |
|
747 |
name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text"; |
748 |
name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text"; |
748 |
|
749 |
|
|
|
750 |
/* This sets tmpname to the name that was used. */ |
749 |
if( (fp = Get_temp(&tmpname, "w")) == NIL(FILE) ) |
751 |
if( (fp = Get_temp(&tmpname, "w")) == NIL(FILE) ) |
750 |
Open_temp_error( tmpname, name ); |
752 |
Open_temp_error( tmpname, name ); |
751 |
|
753 |
|
Lines 768-774
Link Here
|
768 |
fname_suff = DmStrJoin( tmpname, suffix, -1, FALSE ); |
770 |
fname_suff = DmStrJoin( tmpname, suffix, -1, FALSE ); |
769 |
|
771 |
|
770 |
/* Overwrite macro, Get_temp didn't know of the suffix. */ |
772 |
/* Overwrite macro, Get_temp didn't know of the suffix. */ |
771 |
Def_macro( "TMPFILE", fname_suff, M_MULTI|M_EXPANDED ); |
773 |
Def_macro( "TMPFILE", DO_WINPATH(fname_suff), M_MULTI|M_EXPANDED ); |
772 |
|
774 |
|
773 |
if( (fp2 = fopen(fname_suff, "w" )) == NIL(FILE) ) |
775 |
if( (fp2 = fopen(fname_suff, "w" )) == NIL(FILE) ) |
774 |
Open_temp_error( fname_suff, name ); |
776 |
Open_temp_error( fname_suff, name ); |