diff options
author | Shao Miller <sha0.miller@gmail.com> | 2012-11-02 11:59:10 -0400 |
---|---|---|
committer | Shao Miller <sha0.miller@gmail.com> | 2012-11-10 02:04:03 -0500 |
commit | 0b4de4d15b0bbf3b77861eab0e8efe77a626ed21 (patch) | |
tree | fcf149e48e6c06a7992503abe54a9c53fc5edf4f /com32/modules/ady2.c | |
parent | a6671b7d17293cf3f7fac1083ae16542828987b4 (diff) | |
download | syslinux-ady_cat.tar.gz syslinux-ady_cat.tar.xz syslinux-ady_cat.zip |
ady2.c32: For testing a bug reported by Ady2ady_cat
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.
Diffstat (limited to 'com32/modules/ady2.c')
-rw-r--r-- | com32/modules/ady2.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> +#include <console.h> +#include <errno.h> + +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; +} |