Module Name: src Committed By: christos Date: Sun Nov 6 18:18:16 UTC 2011
Modified Files: src/external/bsd/atf/dist/atf-c: tc.c Log Message: don't truncate error messages to 1K. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/dist/atf-c/tc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/atf/dist/atf-c/tc.c diff -u src/external/bsd/atf/dist/atf-c/tc.c:1.8 src/external/bsd/atf/dist/atf-c/tc.c:1.9 --- src/external/bsd/atf/dist/atf-c/tc.c:1.8 Sun Nov 7 12:45:21 2010 +++ src/external/bsd/atf/dist/atf-c/tc.c Sun Nov 6 13:18:16 2011 @@ -156,28 +156,22 @@ static atf_error_t write_resfile(const int fd, const char *result, const int arg, const atf_dynstr_t *reason) { - char buffer[1024]; - int ret; - if (arg == -1 && reason == NULL) { - if (snprintf(buffer, sizeof(buffer), "%s\n", result) <= 0) + if (dprintf(fd, "%s\n", result) <= 0) goto err; } else if (arg == -1 && reason != NULL) { - if (snprintf(buffer, sizeof(buffer), "%s: %s\n", result, - atf_dynstr_cstring(reason)) <= 0) + if (dprintf(fd, "%s: %s\n", result, + atf_dynstr_cstring(reason)) < 0) goto err; } else if (arg != -1 && reason != NULL) { - if (snprintf(buffer, sizeof(buffer), "%s(%d): %s\n", result, - arg, atf_dynstr_cstring(reason)) <= 0) + if (dprintf(fd, "%s(%d): %s\n", result, + arg, atf_dynstr_cstring(reason)) < 0) goto err; } else { UNREACHABLE; } - while ((ret = write(fd, buffer, strlen(buffer))) == -1 && errno == EINTR) - ; /* Retry. */ - if (ret != -1) - return atf_no_error(); + return atf_no_error(); err: return atf_libc_error(