Last active
January 14, 2016 09:39
-
-
Save liviuchircu/00bdc9bad3b750e8a265 to your computer and use it in GitHub Desktop.
Fix compile issues on Solaris
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dprint.h b/dprint.h | |
index 6a75f79..4c5cdde 100644 | |
--- a/dprint.h | |
+++ b/dprint.h | |
@@ -52,8 +52,6 @@ | |
#include <syslog.h> | |
#include <time.h> | |
-#include "pt.h" | |
- | |
#define L_ALERT -3 /*!< Alert level */ | |
#define L_CRIT -2 /*!< Critical level */ | |
#define L_ERR -1 /*!< Error level */ | |
@@ -103,56 +101,12 @@ extern int log_facility; | |
extern char* log_name; | |
extern char ctime_buf[]; | |
-/* | |
- * must be called after init_multi_proc_support() | |
- * must be called once for each OpenSIPS process | |
- */ | |
-int init_debug(void); | |
- | |
-/* must be called once, before the "pt" process table is freed */ | |
-void cleanup_debug(void); | |
- | |
int dp_my_pid(void); | |
void dprint (char* format, ...); | |
int str2facility(char *s); | |
-/* | |
- * set the (default) log level of a given process | |
- * | |
- * Note: the index param is not validated! | |
- */ | |
-static inline void __set_proc_debug_level(int proc_idx, int level) | |
-{ | |
- pt[proc_idx].debug = level; | |
-} | |
- | |
-static inline void __set_proc_default_debug(int proc_idx, int level) | |
-{ | |
- pt[proc_idx].default_debug = level; | |
-} | |
- | |
-/* set the current and default log levels for all OpenSIPS processes */ | |
-static inline void set_global_debug_level(int level) | |
-{ | |
- int i; | |
- | |
- for (i = 0; i < counted_processes; i++) { | |
- __set_proc_default_debug(i, level); | |
- __set_proc_debug_level(i, level); | |
- } | |
-} | |
- | |
-/* set the log level of the current process */ | |
-static inline void set_proc_debug_level(int level) | |
-{ | |
- __set_proc_debug_level(process_no, level); | |
-} | |
- | |
- | |
-/* changes the logging level to the default value for the current process */ | |
-void reset_proc_debug_level(void); | |
static inline char* dp_time(void) | |
{ | |
@@ -445,5 +399,52 @@ static inline char* dp_time(void) | |
#endif /*SUN_PRO_C*/ | |
#endif | |
+#include "pt.h" | |
+ | |
+/* | |
+ * must be called after init_multi_proc_support() | |
+ * must be called once for each OpenSIPS process | |
+ */ | |
+int init_debug(void); | |
+ | |
+/* must be called once, before the "pt" process table is freed */ | |
+void cleanup_debug(void); | |
+ | |
+/* | |
+ * set the (default) log level of a given process | |
+ * | |
+ * Note: the index param is not validated! | |
+ */ | |
+static inline void __set_proc_debug_level(int proc_idx, int level) | |
+{ | |
+ pt[proc_idx].debug = level; | |
+} | |
+ | |
+static inline void __set_proc_default_debug(int proc_idx, int level) | |
+{ | |
+ pt[proc_idx].default_debug = level; | |
+} | |
+ | |
+/* set the current and default log levels for all OpenSIPS processes */ | |
+static inline void set_global_debug_level(int level) | |
+{ | |
+ int i; | |
+ | |
+ for (i = 0; i < counted_processes; i++) { | |
+ __set_proc_default_debug(i, level); | |
+ __set_proc_debug_level(i, level); | |
+ } | |
+} | |
+ | |
+/* set the log level of the current process */ | |
+static inline void set_proc_debug_level(int level) | |
+{ | |
+ __set_proc_debug_level(process_no, level); | |
+} | |
+ | |
+ | |
+/* changes the logging level to the default value for the current process */ | |
+void reset_proc_debug_level(void); | |
+ | |
#endif /* ifndef dprint_h */ | |
diff --git a/io_wait_loop.h b/io_wait_loop.h | |
index 1bcb78c..07857d1 100644 | |
--- a/io_wait_loop.h | |
+++ b/io_wait_loop.h | |
@@ -399,6 +399,7 @@ inline static int io_wait_loop_devpoll(io_wait_h* h, int t, int repeat) | |
int n, r; | |
int ret; | |
struct dvpoll dpoll; | |
+ struct fd_map *e; | |
dpoll.dp_timeout=t*1000; | |
dpoll.dp_nfds=h->fd_no; | |
diff --git a/pt.h b/pt.h | |
index 5ca97dd..b417798 100644 | |
--- a/pt.h | |
+++ b/pt.h | |
@@ -31,10 +31,10 @@ | |
#include <sys/types.h> | |
#include <unistd.h> | |
-#include "statistics.h" | |
- | |
#define MAX_PT_DESC 128 | |
+typedef struct stat_var_ stat_var; | |
+ | |
struct process_table { | |
int pid; | |
int unix_sock; /* unix socket on which tcp main listens */ | |
@@ -67,5 +67,6 @@ inline static int my_pid(void) | |
return pt ? pt[process_no].pid : getpid(); | |
} | |
+#include "statistics.h" | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment