mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
conftest: fix transposed size and count arguments to fwrite.
* tests/conftest.c: Include <string.h> and <errno.h>. Also include strerror in diagnostic. Author: Jim Meyering <meyering@redhat.com>
This commit is contained in:
parent
92c8d7dd97
commit
a8b9c6640a
@ -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>
|
Mon Nov 12 14:56:33 CET 2007 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
Begin fixing uses of strtol: parse integers more carefully.
|
Begin fixing uses of strtol: parse integers more carefully.
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@ -25,8 +27,8 @@ int main(int argc, char **argv) {
|
|||||||
exit(3);
|
exit(3);
|
||||||
}
|
}
|
||||||
virConfFree(conf);
|
virConfFree(conf);
|
||||||
if (fwrite(buffer, len, 1, stdout) != len) {
|
if (fwrite(buffer, 1, len, stdout) != len) {
|
||||||
fprintf(stderr, "Write failed\n");
|
fprintf(stderr, "Write failed: %s\n", strerror (errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user