]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/message.c
Add missing files for xattr and eliminate a few compiler complaints
[bacula/bacula] / bacula / src / lib / message.c
index a7141d33873051cc0b613c03a1e2f335f90fd05c..1371bbc05fea1254595b4c739ad6b48f3d343ddf 100644 (file)
@@ -51,7 +51,7 @@ const char *working_directory = NULL;       /* working directory path stored her
 int verbose = 0;                      /* increase User messages */
 int debug_level = 0;                  /* debug level */
 bool dbg_timestamp = false;           /* print timestamp in debug output */
-time_t daemon_start_time = 0;         /* Daemon start time */
+utime_t daemon_start_time = 0;        /* Daemon start time */
 const char *version = VERSION " (" BDATE ")";
 char my_name[30];                     /* daemon name is stored here */
 char host_name[50];                   /* host machine name */
@@ -62,23 +62,6 @@ char con_fname[500];                  /* Console filename */
 FILE *con_fd = NULL;                  /* Console file descriptor */
 brwlock_t con_lock;                   /* Console lock structure */
 
-
-/*
- * 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;
-
-void print_lock_dbg()
-{
-   char buf[128];
-   bstrutime(buf, sizeof(buf), _db_lock_time);
-
-   fprintf(stderr, "lock info: recurse_count=%i threadid=0x%x time=%s\n",
-           _db_lock_recurse_count, (int)_db_lock_threadid, buf);
-}
-
 /* Forward referenced functions */
 
 /* Imported functions */
@@ -617,7 +600,7 @@ static bool open_dest_file(JCR *jcr, DEST *d, const char *mode)
 /*
  * Handle sending the message to the appropriate place
  */
-void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
+void dispatch_message(JCR *jcr, int type, utime_t mtime, char *msg)
 {
     DEST *d;
     char dt[MAX_TIME_LENGTH];
@@ -633,7 +616,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
      * Most messages are prefixed by a date and time. If mtime is
      *  zero, then we use the current time.  If mtime is 1 (special
      *  kludge), we do not prefix the date and time. Otherwise,
-     *  we assume mtime is a time_t and use it.
+     *  we assume mtime is a utime_t and use it.
      */
     if (mtime == 0) {
        mtime = time(NULL);
@@ -801,7 +784,7 @@ send_to_file:
              case MD_DIRECTOR:
                 Dmsg1(850, "DIRECTOR for following msg: %s", msg);
                 if (jcr && jcr->dir_bsock && !jcr->dir_bsock->errors) {
-                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s",
+                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%lld %s",
                       jcr->Job, type, mtime, msg);
                 }
                 break;
@@ -868,7 +851,7 @@ d_msg(const char *file, int line, int level, const char *fmt,...)
     int       len;
     va_list   arg_ptr;
     bool      details = true;
-    time_t    mtime;
+    utime_t   mtime;
 
     if (level < 0) {
        details = false;
@@ -1027,8 +1010,6 @@ t_msg(const char *file, int line, int level, const char *fmt,...)
    }
 }
 
-
-
 /* *********************************************************
  *
  * print an error message
@@ -1102,7 +1083,7 @@ e_msg(const char *file, int line, int type, int level, const char *fmt,...)
  *
  */
 void
-Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
+Jmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...)
 {
     char     rbuf[5000];
     va_list   arg_ptr;
@@ -1199,7 +1180,7 @@ Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
  * If we come here, prefix the message with the file:line-number,
  *  then pass it on to the normal Jmsg routine.
  */
-void j_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const char *fmt,...)
+void j_msg(const char *file, int line, JCR *jcr, int type, utime_t mtime, const char *fmt,...)
 {
    va_list   arg_ptr;
    int i, len, maxlen;
@@ -1342,7 +1323,7 @@ static pthread_mutex_t msg_queue_mutex = PTHREAD_MUTEX_INITIALIZER;
  *  sending a message, it is a bit messy to recursively call
  *  yourself when the bnet packet is not reentrant).
  */
-void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
+void Qmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...)
 {
    va_list   arg_ptr;
    int len, maxlen;
@@ -1409,7 +1390,7 @@ bail_out:
  * If we come here, prefix the message with the file:line-number,
  *  then pass it on to the normal Qmsg routine.
  */
-void q_msg(const char *file, int line, JCR *jcr, int type, time_t mtime, const char *fmt,...)
+void q_msg(const char *file, int line, JCR *jcr, int type, utime_t mtime, const char *fmt,...)
 {
    va_list   arg_ptr;
    int i, len, maxlen;