cURL / Mailing Lists / curl-users / Single Mail

curl-users

[Patch] src/tool_dirhie.c

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Sat, 23 Mar 2013 15:22:25 +0100

Some issues with the src/tool_dirhie.c file.

*) djgpp already has a 'mkdir(path,mode)' in it's <sys/stat.h>.
  So don't mess with it.

*) The redefinition of 'F_OK' is wrong. djgpp 2.04 has this set to:
    #define F_OK 0x01

  in it's <unistd.h>. A quick search through the other DOS-compilers
  I have here, shows that High-C and OpenWatcom uses 'F_OK 0'.
  Borland + Quick-C doesn't have it at all.

So I suggest the following patch:

--- Git-latest\src\tool_dirhie.c Thu Mar 07 19:31:29 2013
+++ src\tool_dirhie.c Sat Mar 23 14:40:12 2013
@@ -41,9 +41,9 @@
 # endif
 #endif

-#ifdef WIN32
+#if defined(WIN32) || (defined(MSDOS) && !defined(__DJGPP__))
 # define mkdir(x,y) (mkdir)((x))
-# ifndef __POCC__
+# ifndef F_OK
 # define F_OK 0
 # endif
 #endif

-------------

For all Windows targets, I think it's safe to potentially redefine F_OK to 0.
http://msdn.microsoft.com/en-us/library/aa246685(v=vs.60).aspx
states access() needs a '0' to check for "Existence only".

--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-23