From 0b4de4d15b0bbf3b77861eab0e8efe77a626ed21 Mon Sep 17 00:00:00 2001 From: Shao Miller Date: Fri, 2 Nov 2012 11:59:10 -0400 Subject: ady2.c32: For testing a bug reported by Ady2 Ady2 reported a bug with Slitaz' md5sum.c32, but it turns out that running this special .c32 module on the filename: /ubcd/custom/syslinux-5.00-pre9/com32/gplinclude/acpi/facs.h produces an error after 134 iterations, with Ady2's .ISO. --- com32/modules/ady2.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 com32/modules/ady2.c (limited to 'com32/modules/ady2.c') diff --git a/com32/modules/ady2.c b/com32/modules/ady2.c new file mode 100644 index 00000000..95eb0d17 --- /dev/null +++ b/com32/modules/ady2.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + static unsigned char iterations = 1; + int src_fd; + + openconsole(&dev_stdcon_r, &dev_stdcon_w); + + if (argc < 2) { + fprintf(stderr, "Usage: %s filename...\n", argv[0]); + return 1; + } + + while (1) { + + errno = 0; + printf("---OPEN---"); + src_fd = open(argv[1], O_RDONLY); + if (src_fd < 0) { + printf("Finally failed after %u iterations with error: %d\n", + iterations, errno); + return 1; + } + close(src_fd); + printf("---CLOSE---"); + if (!iterations++) + return 1; + } + printf("No failure\n"); + return 0; +} -- cgit v1.2.3