* tests/conftest.c: Include <string.h> and <errno.h>.
Also include strerror in diagnostic.
Author: Jim Meyering <meyering@redhat.com>
+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.
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
+#include <errno.h>
#include "conf.h"
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);