]> git.sur5r.net Git - bacula/bacula/commitdiff
Add mingw files and changes
authorKern Sibbald <kern@sibbald.com>
Sun, 16 Apr 2006 09:56:01 +0000 (09:56 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 16 Apr 2006 09:56:01 +0000 (09:56 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2921 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/bpipe.c
bacula/src/lib/util.c

index b87f106ab53b99310f4ce7afc9971eb5f0823a14..630edcc2659ae39e643148f5e2d0af1ca505f226 100644 (file)
 #include "bacula.h"
 #include "jcr.h"
 
-int execvp_errors[] = {EACCES, ENOEXEC, EFAULT, EINTR, E2BIG,
-                     ENAMETOOLONG, ENOMEM, ETXTBSY, ENOENT};
+int execvp_errors[] = {
+       EACCES,
+       ENOEXEC,
+       EFAULT,
+       EINTR,
+       E2BIG,
+       ENAMETOOLONG,
+       ENOMEM,
+#ifndef WIN32
+       ETXTBSY,
+#endif
+       ENOENT
+};
 int num_execvp_errors = (int)(sizeof(execvp_errors)/sizeof(int));
 
 
@@ -221,7 +232,11 @@ int close_bpipe(BPIPE *bpipe)
          }
          Dmsg1(800, "child status=%d\n", stat & ~b_errno_exit);
       } else if (WIFSIGNALED(chldstatus)) {  /* process died */
+#ifndef WIN32
          stat = WTERMSIG(chldstatus);
+#else
+#warning "WTERMSIG undefined in Win32 !!!"
+#endif
          Dmsg1(800, "Child died from signale %d\n", stat);
          stat |= b_errno_signal;      /* exit signal returned */
       }
index 95799f2498b19841340da8a8b976e3872fcc08de..6fd842072ccafa1eb8f98ec1d636877cfb66d831 100644 (file)
@@ -120,7 +120,8 @@ unbash_spaces(POOL_MEM &pm)
    }
 }
 
-#if    HAVE_WIN32 && !HAVE_CONSOLE && !HAVE_WXCONSOLE
+/* kludge below disabled for MinGW, due to link problems ... */
+#if    HAVE_WIN32 && !HAVE_CONSOLE && !HAVE_WXCONSOLE && !HAVE_MINGW
 extern long _timezone;
 extern int _daylight;
 extern long _dstbias;
@@ -133,7 +134,7 @@ char *encode_time(time_t time, char *buf)
    struct tm tm;
    int n = 0;
 
-#if    HAVE_WIN32 && !HAVE_CONSOLE && !HAVE_WXCONSOLE
+#if    HAVE_WIN32 && !HAVE_CONSOLE && !HAVE_WXCONSOLE && !HAVE_MINGW
     /*
      * Gross kludge to avoid a seg fault in Microsoft's CRT localtime_r(),
      *  which incorrectly references a NULL returned from gmtime() if