more Compiler tweaks for useithreads
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 18edf7a..d5c5426 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -112,24 +112,23 @@ extern int h_errno;
 #    include <utime.h>
 #  endif
 #endif
-#ifdef I_FCNTL
-#include <fcntl.h>
-#endif
-#ifdef I_SYS_FILE
-#include <sys/file.h>
-#endif
 
 /* Put this after #includes because fork and vfork prototypes may conflict. */
 #ifndef HAS_VFORK
 #   define vfork fork
 #endif
 
-/* Put this after #includes because <unistd.h> defines _XOPEN_*. */
+/* Put this after #includes because <unistd.h> defines _XOPEN_*.
+ * Sock_size_t is defined identically in doio.c. */
 #ifndef Sock_size_t
-#  if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) || defined(__GLIBC__)
-#    define Sock_size_t Size_t
+#  ifdef HAS_SOCKLEN_T
+#      define Sock_size_t socklen_t
 #  else
-#    define Sock_size_t int
+#      if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) || defined(__GLIBC__)
+#          define Sock_size_t Size_t
+#      else
+#          define Sock_size_t int
+#      endif
 #  endif
 #endif
 
@@ -3382,12 +3381,19 @@ S_dooneliner(pTHX_ char *cmd, char *filename)
 PP(pp_mkdir)
 {
     djSP; dTARGET;
-    int mode = POPi;
+    int mode;
 #ifndef HAS_MKDIR
     int oldumask;
 #endif
     STRLEN n_a;
-    char *tmps = SvPV(TOPs, n_a);
+    char *tmps;
+
+    if (MAXARG > 1)
+       mode = POPi;
+    else
+       mode = 0777;
+
+    tmps = SvPV(TOPs, n_a);
 
     TAINT_PROPER("mkdir");
 #ifdef HAS_MKDIR