]> git.wh0rd.org Git - elf2flt.git/commitdiff
Add support for win32 (non-cygwin) builds of elf2flt
authorJohn Williams <jwilliams@itee.uq.edu.au>
Mon, 8 Nov 2004 00:25:31 +0000 (00:25 +0000)
committerJohn Williams <jwilliams@itee.uq.edu.au>
Mon, 8 Nov 2004 00:25:31 +0000 (00:25 +0000)
Fix minor typo in error message

Patch submitted by Scott Thibault <thibault@gmvhdl.com>

elf2flt.c

index 31f23f231a6c7484da61d579cd844d75ffddac33..b0ef6ca3a4bf4d835f63c5aac06912332ed96e49 100644 (file)
--- a/elf2flt.c
+++ b/elf2flt.c
 #include <unistd.h>   /* Userland prototypes of the Unix std system calls    */
 #include <fcntl.h>    /* Flag value for file handling functions              */
 #include <time.h>
-
+#ifndef WIN32
 #include <netinet/in.h> /* Consts and structs defined by the internet system */
+#else
+#include <winsock2.h>
+#endif
 
 /* from $(INSTALLDIR)/include       */
 #include <bfd.h>      /* Main header file for the BFD library                */
@@ -1686,9 +1689,9 @@ int main(int argc, char *argv[])
                } \
        } while (0)
 
-  gf = fopen(ofile, "a");
+  gf = fopen(ofile, "ab");     /* Add 'b' to support non-posix (ie windows) */
   if (!gf) {
-       fprintf(stderr, "Can't opne file %s for writing\n", ofile); \
+       fprintf(stderr, "Can't open file %s for writing\n", ofile); \
        exit(4);
   }