]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/testing/tcdbm_mingw.patch
ebl Update about STAP
[bacula/bacula] / bacula / patches / testing / tcdbm_mingw.patch
1 Index: myconf.h
2 ===================================================================
3 --- myconf.h    (revision 7238)
4 +++ myconf.h    (working copy)
5 @@ -206,13 +206,18 @@
6  #include <unistd.h>
7  #include <sys/types.h>
8  #include <sys/stat.h>
9 -#include <sys/mman.h>
10  #include <sys/time.h>
11 -#include <sys/times.h>
12  #include <fcntl.h>
13  #include <dirent.h>
14 +
15 +#ifdef HAVE_WIN32
16 +#include "compat.h"
17 +#else
18 +#include <sys/mman.h>
19 +#include <sys/times.h>
20  #include <regex.h>
21  #include <glob.h>
22 +#endif
23  
24  #if TCUSEPTHREAD
25  #include <pthread.h>
26 Index: tcutil.c
27 ===================================================================
28 --- tcutil.c    (revision 7238)
29 +++ tcutil.c    (working copy)
30 @@ -17,7 +17,6 @@
31  #include "tcutil.h"
32  #include "myconf.h"
33  
34 -
35  /*************************************************************************************************
36   * basic utilities
37   *************************************************************************************************/
38 @@ -3333,6 +3332,7 @@
39  
40  /* Lock a file. */
41  bool tclock(int fd, bool ex, bool nb){
42 +#ifndef HAVE_WIN32
43    assert(fd >= 0);
44    struct flock lock;
45    memset(&lock, 0, sizeof(struct flock));
46 @@ -3344,6 +3344,7 @@
47    while(fcntl(fd, nb ? F_SETLK : F_SETLKW, &lock) == -1){
48      if(errno != EINTR) return false;
49    }
50 +#endif
51    return true;
52  }
53