From: Kern Sibbald Date: Sun, 16 Apr 2006 09:56:01 +0000 (+0000) Subject: Add mingw files and changes X-Git-Tag: Release-7.0.0~8070 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e7fb5330239ca268cea37e51b2c19b62466c55c9;p=bacula%2Fbacula Add mingw files and changes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2921 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index b87f106ab5..630edcc265 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -24,8 +24,19 @@ #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 */ } diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index 95799f2498..6fd842072c 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -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