From 7f01830927969a8386050617385e59070fe9f34b Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 28 Apr 2013 01:19:19 -0400 Subject: Add support for per-job output sync. A new flag to the -O/--output-sync, "job", selects a per-job (that is, per line of a recipe) output synchronization. To support this move the close of the temp file out of the sync_output() function and don't do it until we free the child, since we may call sync_output() multiple times in a given recipe. When we set up for a new temp file, if we're in per-job mode we truncate the file and seek to the beginning to re-use it for every job. --- job.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'job.h') diff --git a/job.h b/job.h index df74270..f15b54c 100644 --- a/job.h +++ b/job.h @@ -99,16 +99,14 @@ struct child #endif unsigned int command_line; /* Index into command_lines. */ - pid_t pid; /* Child process's ID number. */ + int outfd; /* File descriptor for saving stdout */ + int errfd; /* File descriptor for saving stderr */ + pid_t pid; /* Child process's ID number. */ unsigned int remote:1; /* Nonzero if executing remotely. */ unsigned int noerror:1; /* Nonzero if commands contained a '-'. */ unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ unsigned int deleted:1; /* Nonzero if targets have been deleted. */ unsigned int dontcare:1; /* Saved dontcare flag. */ -#ifdef OUTPUT_SYNC - int outfd; /* File descriptor for saving stdout */ - int errfd; /* File descriptor for saving stderr */ -#endif }; extern struct child *children; -- cgit v1.2.3