[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] patch: fix cats modules for win32


Hello,
recently some debug variables where added to signal.c, which unfortunately is not compiled on windows.
This patch moves the variables to bsys.c and fixes the link.

Riccardo
Index: src/win32/cats/Makefile
===================================================================
--- src/win32/cats/Makefile	(revision 8020)
+++ src/win32/cats/Makefile	(working copy)
@@ -61,17 +61,17 @@
 $(BINDIR)/cats_mysql.dll: $(addprefix $(OBJDIR)/cats_mysql/,mysql.o $(SQL_OBJS)) $(OBJDIR)/libcats.exp
 	@echo "Linking $@"
 	$(call checkdir,$@)
-	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_MYSQL) $(LIBS_DLL) -o $@
+	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_MYSQL) $(LIBS_DLL) $(LIBS_PTHREADS) -o $@
 
 $(BINDIR)/cats_postgresql.dll: $(addprefix $(OBJDIR)/cats_postgresql/,postgresql.o $(SQL_OBJS)) $(OBJDIR)/libcats.exp
 	@echo "Linking $@"
 	$(call checkdir,$@)
-	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_POSTGRESQL) $(LIBS_DLL) -o $@
+	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_POSTGRESQL) $(LIBS_DLL) $(LIBS_PTHREADS) -o $@
 
 $(BINDIR)/cats_sqlite3.dll: $(addprefix $(OBJDIR)/cats_sqlite3/,sqlite.o $(SQL_OBJS)) $(OBJDIR)/libcats.exp
 	@echo "Linking $@"
 	$(call checkdir,$@)
-	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_SQLITE) $(LIBS_DLL) -o $@
+	$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows $^ $(LIBS_SQLITE) $(LIBS_DLL) $(LIBS_PTHREADS) -o $@
 
 #
 # Rules for generating from ../cats
Index: src/lib/protos.h
===================================================================
--- src/lib/protos.h	(revision 8020)
+++ src/lib/protos.h	(working copy)
@@ -79,7 +79,14 @@
 void      read_state_file(char *dir, const char *progname, int port);
 int       b_strerror(int errnum, char *buf, size_t bufsiz);
 char     *escape_filename(const char *file_path);
+/* Used to debug database lock
+ * which job takes the main DB access
+ */
+extern DLL_IMP_EXP utime_t      _db_lock_time;
+extern DLL_IMP_EXP int          _db_lock_recurse_count;
+extern DLL_IMP_EXP pthread_t    _db_lock_threadid;
 
+
 /* bnet.c */
 int32_t    bnet_recv             (BSOCK *bsock);
 bool       bnet_send             (BSOCK *bsock);
@@ -252,13 +259,6 @@
 void             init_signals             (void terminate(int sig));
 void             init_stack_dump          (void);
 
-/* Used to debug database lock 
- * which job takes the main DB access 
- */
-extern DLL_IMP_EXP utime_t      _db_lock_time;
-extern DLL_IMP_EXP int          _db_lock_recurse_count;
-extern DLL_IMP_EXP pthread_t    _db_lock_threadid;
-
 /* scan.c */
 void             strip_leading_space     (char *str);
 void             strip_trailing_junk     (char *str);
Index: src/lib/signal.c
===================================================================
--- src/lib/signal.c	(revision 8020)
+++ src/lib/signal.c	(working copy)
@@ -72,13 +72,6 @@
    }
 }
 
-/*
- * Global variables to get information about lock/unlock db access
- */
-utime_t _db_lock_time = 0;
-int _db_lock_recurse_count = 0;
-pthread_t _db_lock_threadid;
-
 static void print_lock_dbg(FILE *fp)
 {
    char buf[128];
Index: src/lib/bsys.c
===================================================================
--- src/lib/bsys.c	(revision 8020)
+++ src/lib/bsys.c	(working copy)
@@ -47,7 +47,14 @@
 extern "C" int initgroups(const char *,int);
 #endif
 
+/*
+ * Global variables to get information about lock/unlock db access
+ */
+utime_t _db_lock_time = 0;
+int _db_lock_recurse_count = 0;
+pthread_t _db_lock_threadid;
 
+
 static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilot Consulting.