git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ocaml: Error on compiler warnings.
[libguestfs.git]
/
generator
/
generator_capitests.ml
diff --git
a/generator/generator_capitests.ml
b/generator/generator_capitests.ml
index
6f5f59c
..
325b37c
100644
(file)
--- a/
generator/generator_capitests.ml
+++ b/
generator/generator_capitests.ml
@@
-181,14
+181,8
@@
int main (int argc, char *argv[])
perror (filename);
exit (EXIT_FAILURE);
}
perror (filename);
exit (EXIT_FAILURE);
}
- if (lseek (fd, %d, SEEK_SET) == -1) {
- perror (\"lseek\");
- close (fd);
- unlink (filename);
- exit (EXIT_FAILURE);
- }
- if (write (fd, &c, 1) == -1) {
- perror (\"write\");
+ if (ftruncate (fd, %d) == -1) {
+ perror (\"ftruncate\");
close (fd);
unlink (filename);
exit (EXIT_FAILURE);
close (fd);
unlink (filename);
exit (EXIT_FAILURE);
@@
-209,14
+203,8
@@
int main (int argc, char *argv[])
perror (filename);
exit (EXIT_FAILURE);
}
perror (filename);
exit (EXIT_FAILURE);
}
- if (lseek (fd, %d, SEEK_SET) == -1) {
- perror (\"lseek\");
- close (fd);
- unlink (filename);
- exit (EXIT_FAILURE);
- }
- if (write (fd, &c, 1) == -1) {
- perror (\"write\");
+ if (ftruncate (fd, %d) == -1) {
+ perror (\"ftruncate\");
close (fd);
unlink (filename);
exit (EXIT_FAILURE);
close (fd);
unlink (filename);
exit (EXIT_FAILURE);
@@
-237,14
+225,8
@@
int main (int argc, char *argv[])
perror (filename);
exit (EXIT_FAILURE);
}
perror (filename);
exit (EXIT_FAILURE);
}
- if (lseek (fd, %d, SEEK_SET) == -1) {
- perror (\"lseek\");
- close (fd);
- unlink (filename);
- exit (EXIT_FAILURE);
- }
- if (write (fd, &c, 1) == -1) {
- perror (\"write\");
+ if (ftruncate (fd, %d) == -1) {
+ perror (\"ftruncate\");
close (fd);
unlink (filename);
exit (EXIT_FAILURE);
close (fd);
unlink (filename);
exit (EXIT_FAILURE);