]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conftest: fix transposed size and count arguments to fwrite.
authorJim Meyering <meyering@redhat.com>
Mon, 12 Nov 2007 22:16:25 +0000 (22:16 +0000)
committerJim Meyering <meyering@redhat.com>
Mon, 12 Nov 2007 22:16:25 +0000 (22:16 +0000)
* tests/conftest.c: Include <string.h> and <errno.h>.
Also include strerror in diagnostic.

Author: Jim Meyering <meyering@redhat.com>

ChangeLog
tests/conftest.c

index 2d5a228ee4e04bc152e30d1da7dc1a4ed5469d41..684ef4f23b0b88f8f2314b93e5c49fe1ccf68bd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Nov 12 23:11:35 CET 2007 Jim Meyering <meyering@redhat.com>
+
+       conftest: fix transposed size and count arguments to fwrite.
+       * tests/conftest.c: Include <string.h> and <errno.h>.
+         Also include strerror in diagnostic.
+
 Mon Nov 12 14:56:33 CET 2007 Daniel Veillard <veillard@redhat.com>
 
        Begin fixing uses of strtol: parse integers more carefully.
index 604e410ffa2dc7dcf63be7b736348840c98b5e80..9c8e3a695868201039a97b5d9c8483024a6e97cf 100644 (file)
@@ -1,6 +1,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
 #include "conf.h"
 
 int main(int argc, char **argv) {
@@ -25,8 +27,8 @@ int main(int argc, char **argv) {
        exit(3);
     }
     virConfFree(conf);
-    if (fwrite(buffer, len, 1, stdout) != len) {
-        fprintf(stderr, "Write failed\n");
+    if (fwrite(buffer, 1, len, stdout) != len) {
+       fprintf(stderr, "Write failed: %s\n", strerror (errno));
        exit(1);
     }
     exit(0);