Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- unowfs.c 2011-06-26 19:10:44 -0300
- +++ unowfs_new.c 2011-06-26 19:50:53 -0300
- @@ -1,7 +1,10 @@
- /*
- * Utility to extract files from OWFS file system images.
- *
- + * On Unix
- * $ gcc -Wall unowfs.c -o unowfs
- + * On Windows
- + * $ gcc -Wall unowfs.c -lws2_32 -o unowfs.exe
- *
- * Craig Heffner, 20 June 2011
- * http://www.devttys0.com
- @@ -15,7 +18,12 @@
- #include <unistd.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- +#ifdef UNIX
- #include <arpa/inet.h>
- +#endif
- +#ifdef _WIN32
- +#include <winsock2.h>
- +#endif
- #define MAGIC "owowowowowowowowowowowowowowowow"
- #define MAGIC_SIZE 32
- @@ -79,7 +87,11 @@
- goto end;
- }
- +#ifdef UNIX
- if(mkdir(dir, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0)
- +#elseif defined _WIN32
- + if(mkdir(dir) < 0)
- +#endif
- {
- perror(dir);
- goto end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement