diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2008-06-04 19:41:06 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2008-06-04 19:41:06 +0000 |
| commit | 9514c2befb37a68d5e28eac47c4612332897873a (patch) | |
| tree | 799f9962a756c2f0ec0f081e03f3d2a56e1cbc06 /buildtool.cpp | |
| parent | Remove warnings (diff) | |
| download | inkscape-9514c2befb37a68d5e28eac47c4612332897873a.tar.gz inkscape-9514c2befb37a68d5e28eac47c4612332897873a.zip | |
improve piping
(bzr r5807)
Diffstat (limited to 'buildtool.cpp')
| -rw-r--r-- | buildtool.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/buildtool.cpp b/buildtool.cpp index 414c8e3fc..471a8194c 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -38,7 +38,7 @@ * */ -#define BUILDTOOL_VERSION "BuildTool v0.9.2" +#define BUILDTOOL_VERSION "BuildTool v0.9.3" #include <stdio.h> #include <fcntl.h> @@ -3551,14 +3551,31 @@ void MakeBase::error(const char *fmt, ...) void MakeBase::status(const char *fmt, ...) { va_list args; - va_start(args,fmt); //fprintf(stdout, " "); + va_start(args,fmt); vfprintf(stdout, fmt, args); + va_end(args); fprintf(stdout, "\n"); + fflush(stdout); +} + + +/** + * Print a printf()-like formatted trace message + */ +void MakeBase::trace(const char *fmt, ...) +{ + va_list args; + fprintf(stdout, "Make: "); + va_start(args,fmt); + vfprintf(stdout, fmt, args); va_end(args) ; + fprintf(stdout, "\n"); + fflush(stdout); } + /** * Resolve another path relative to this one */ @@ -3571,20 +3588,6 @@ String MakeBase::resolve(const String &otherPath) } -/** - * Print a printf()-like formatted trace message - */ -void MakeBase::trace(const char *fmt, ...) -{ - va_list args; - va_start(args,fmt); - fprintf(stdout, "Make: "); - vfprintf(stdout, fmt, args); - fprintf(stdout, "\n"); - va_end(args) ; -} - - /** * Check if a given string matches a given regex pattern @@ -4048,8 +4051,10 @@ bool MakeBase::executeCommand(const String &command, #else //do it unix-style + String pipeCommand = command; + pipeCommand.append(" 2>&1"); String s; - FILE *f = popen(command.c_str(), "r"); + FILE *f = popen(pipeCommand.c_str(), "r"); int errnum = 0; if (f) { |
