git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
daemon: In sfdisk call blockdev --rereadpt with device name.
[libguestfs.git]
/
generator
/
generator_capitests.ml
diff --git
a/generator/generator_capitests.ml
b/generator/generator_capitests.ml
index
6f5f59c
..
190e10f
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);
@@
-762,6
+744,9
@@
and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
) strs;
pr " NULL\n";
pr " };\n";
) strs;
pr " NULL\n";
pr " };\n";
+ | Pointer _, _ ->
+ (* Difficult to make these pointers in order to run a test. *)
+ assert false
) (List.combine (snd style) args);
let error_code =
) (List.combine (snd style) args);
let error_code =
@@
-817,6
+802,7
@@
and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
pr ", %Ld" i
| Bool _, arg ->
let b = bool_of_string arg in pr ", %d" (if b then 1 else 0)
pr ", %Ld" i
| Bool _, arg ->
let b = bool_of_string arg in pr ", %d" (if b then 1 else 0)
+ | Pointer _, _ -> assert false
) (List.combine (snd style) args);
(match fst style with
) (List.combine (snd style) args);
(match fst style with