summaryrefslogtreecommitdiffstats
path: root/dmake/sysintf.c
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2001-02-13 11:43:28 +0000
committerHans-Joachim Lankenau <hjs@openoffice.org>2001-02-13 11:43:28 +0000
commitd1058de1884c3239461b9a50d6a3a61ab7b07367 (patch)
tree6a47cdfb9270650ad2f6c3bd6645aa623f1d4657 /dmake/sysintf.c
parentmake sure to remove the prefix (diff)
downloadcore-d1058de1884c3239461b9a50d6a3a61ab7b07367.tar.gz
core-d1058de1884c3239461b9a50d6a3a61ab7b07367.zip
fixed left tmpfiles when building group targets
Diffstat (limited to 'dmake/sysintf.c')
-rw-r--r--dmake/sysintf.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/dmake/sysintf.c b/dmake/sysintf.c
index 15ddb5d96976..bfe4efb097dc 100644
--- a/dmake/sysintf.c
+++ b/dmake/sysintf.c
@@ -1,4 +1,4 @@
-/* RCS $Id: sysintf.c,v 1.1.1.1 2000-09-22 15:33:26 hr Exp $
+/* RCS $Id: sysintf.c,v 1.2 2001-02-13 12:43:28 hjs Exp $
--
-- SYNOPSIS
-- System independent interface
@@ -450,7 +450,7 @@ PUBLIC FILE*
Get_temp(path, suff, op)
char **path;
char *suff;
-int op;
+long op;
{
extern char *tempnam();
@@ -470,8 +470,8 @@ char *suffix;
CELLPTR cp;
char **fname;
{
- FILE *fp;
- char *tmpname;
+ FILE *fp, *fp2;
+ char *tmpname, *tmpname2;
char *name;
name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text";
@@ -482,6 +482,21 @@ char **fname;
Link_temp( cp, fp, tmpname );
*fname = tmpname;
+/*
+ * link tempfiles generated by tempnam() to make sure that
+ * they will be removed
+*/
+ if ( *suffix != '\0' )
+ {
+ tmpname2 = MALLOC( strlen( tmpname ) - strlen( suffix ) +1, char );
+ *tmpname2 = '\0';
+ strncat( tmpname2, tmpname, strlen( tmpname ) - strlen( suffix ));
+
+ if( (fp2 = fopen(tmpname2, "w" )) == NIL(FILE) )
+ Open_temp_error( tmpname2, name );
+ Link_temp( cp, fp2, tmpname2 );
+ }
+
return( fp );
}