diff options
author | Paul Smith <psmith@gnu.org> | 2013-05-05 17:03:51 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-05-05 17:03:51 -0400 |
commit | 1d992d8fe75f5dbc832cbcfe82e3f56489f7df54 (patch) | |
tree | a769b3a2d4a0b69d83d4cef739f745f2afbabf6c /misc.c | |
parent | 3484c9675a8a09904e08e00bf6842d834cd0201d (diff) | |
download | gunmake-1d992d8fe75f5dbc832cbcfe82e3f56489f7df54.tar.gz |
Ensure command lines are written synchronously with -O.
If output-sync is enabled, have make write the command line to the temp file
instead of printing it directly to the screen to ensure that the output is
ordered properly. Also, remove extraneous enter/leave operations by having
them printed directly when dumping temp file output.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 24 |
1 files changed, 4 insertions, 20 deletions
@@ -179,11 +179,11 @@ concat (unsigned int num, ...) return result; } -/* If we had a standard-compliant vsnprintf() this would be a lot simpler. - Maybe in the future we'll include gnulib's version. */ /* Return a formatted string buffer. - LENGTH must be the maximum length of all format arguments, stringified. */ + LENGTH must be the maximum length of all format arguments, stringified. + If we had a standard-compliant vsnprintf() this would be a lot simpler. + Maybe in the future we'll include gnulib's version. */ const char * message_s (unsigned int length, int prefix, const char *fmt, ...) @@ -215,8 +215,6 @@ message_s (unsigned int length, int prefix, const char *fmt, ...) vsprintf (bp, fmt, args); va_end (args); - strcat (bp, "\n"); - return buffer; } @@ -253,8 +251,6 @@ error_s (unsigned int length, const gmk_floc *flocp, const char *fmt, ...) vsprintf (bp, fmt, args); va_end (args); - strcat (bp, "\n"); - return buffer; } @@ -270,9 +266,6 @@ message (int prefix, const char *fmt, ...) if (fmt != 0) { - if (output_sync) - log_working_directory (1, 1); - if (prefix) { if (makelevel == 0) @@ -284,9 +277,6 @@ message (int prefix, const char *fmt, ...) vfprintf (stdout, fmt, args); va_end (args); putchar ('\n'); - - if (output_sync) - log_working_directory (0, 1); } fflush (stdout); @@ -299,10 +289,7 @@ error (const gmk_floc *flocp, const char *fmt, ...) { va_list args; - if (output_sync) - log_working_directory (1, 1); - else - log_working_directory (1, 0); + log_working_directory (1, 0); if (flocp && flocp->filenm) fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno); @@ -317,9 +304,6 @@ error (const gmk_floc *flocp, const char *fmt, ...) putc ('\n', stderr); fflush (stderr); - - if (output_sync) - log_working_directory (0, 1); } /* Print an error message and exit. */ |