diff --git a/src/bin/bash/builtins/Jamfile b/src/bin/bash/builtins/Jamfile index 59130c7285..d01a83ba68 100644 --- a/src/bin/bash/builtins/Jamfile +++ b/src/bin/bash/builtins/Jamfile @@ -47,7 +47,7 @@ rule MkBuiltinsExt actions MkBuiltinsExt1 { - $(2[1]) -externfile $(1[1]) -structfile $(1[2]) -noproduction $(2[2-]) ; + $(2[1]) -externfile $(1[1]) -tempstructfile $(1[2]).temp -structfile $(1[2]) -noproduction $(2[2-]) ; } local bashDefFiles = diff --git a/src/bin/bash/builtins/mkbuiltins.c b/src/bin/bash/builtins/mkbuiltins.c index b8363fed42..5fc28602ce 100644 --- a/src/bin/bash/builtins/mkbuiltins.c +++ b/src/bin/bash/builtins/mkbuiltins.c @@ -221,6 +221,8 @@ main (argc, argv) if (strcmp (arg, "-externfile") == 0) extern_filename = argv[arg_index++]; + else if (strcmp (arg, "-tempstructfile") == 0) + temp_struct_filename = argv[arg_index++]; else if (strcmp (arg, "-structfile") == 0) struct_filename = argv[arg_index++]; else if (strcmp (arg, "-noproduction") == 0) @@ -287,8 +289,11 @@ main (argc, argv) /* Open the files. */ if (struct_filename) { - temp_struct_filename = xmalloc (15); - sprintf (temp_struct_filename, "mk-%ld", (long) getpid ()); + if (!temp_struct_filename) + { + temp_struct_filename = xmalloc (15); + sprintf (temp_struct_filename, "mk-%ld", (long) getpid ()); + } structfile = fopen (temp_struct_filename, "w"); if (!structfile)