Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/atf/dist/atf-c don't truncate error messages to...



details:   https://anonhg.NetBSD.org/src/rev/86c0f55002af
branches:  trunk
changeset: 771043:86c0f55002af
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 06 18:18:16 2011 +0000

description:
don't truncate error messages to 1K.

diffstat:

 external/bsd/atf/dist/atf-c/tc.c |  18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diffs (38 lines):

diff -r 0ad4b63878e3 -r 86c0f55002af external/bsd/atf/dist/atf-c/tc.c
--- a/external/bsd/atf/dist/atf-c/tc.c  Sun Nov 06 17:31:19 2011 +0000
+++ b/external/bsd/atf/dist/atf-c/tc.c  Sun Nov 06 18:18:16 2011 +0000
@@ -156,28 +156,22 @@
 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(



Home | Main Index | Thread Index | Old Index