unsigned long command_count = 1;
+/* Remember the name of the batch file from stdin. */
+
+static char *stdin_nm = 0;
+
\f
/* The usage output. We write it this way to make life easier for the
main (int argc, char **argv, char **envp)
#endif
{
- static char *stdin_nm = 0;
int makefile_status = MAKE_SUCCESS;
struct goaldep *read_files;
PATH_VAR (current_directory);
if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
perror_with_name (_("unlink (temporary file): "), stdin_nm);
+ stdin_nm = NULL;
+
/* If there were no command-line goals, use the default. */
if (goals == 0)
{
if (print_version_flag)
print_version ();
+ /* Get rid of a temp file from reading a makefile from stdin. */
+ if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
+ perror_with_name (_("unlink (temporary file): "), stdin_nm);
+
+ stdin_nm = NULL;
+
/* Wait for children to die. */
err = (status != 0);
while (job_slots_used > 0)