]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.4.4-time_t_64bit.patch
Update date
[bacula/bacula] / bacula / patches / 2.4.4-time_t_64bit.patch
1
2  This patch fixes bug #1247 - 64-bit time_t and varargs don't get along in some
3  printf-like formatting
4
5  Apply it to version 2.4.4 with:
6
7  cd <bacula-source>
8  patch -p0 <2.4.4-time_t_64bit.patch
9  ./configure <your options>
10  make
11  ...
12  make install
13
14
15 Index: src/stored/spool.c
16 ===================================================================
17 --- src/stored/spool.c  (revision 8455)
18 +++ src/stored/spool.c  (working copy)
19 @@ -306,7 +306,7 @@
20     set_new_file_parameters(dcr);
21  
22     /* Subtracting run_time give us elapsed time - wait_time since we started despooling */
23 -   time_t despool_elapsed = time(NULL) - despool_start - jcr->run_time;
24 +   int32_t despool_elapsed = time(NULL) - despool_start - jcr->run_time;
25  
26     if (despool_elapsed <= 0) {
27        despool_elapsed = 1;
28 Index: src/stored/append.c
29 ===================================================================
30 --- src/stored/append.c (revision 8455)
31 +++ src/stored/append.c (working copy)
32 @@ -270,7 +270,7 @@
33     do_fd_commands(jcr);               /* finish dialog with FD */
34  
35  
36 -   time_t job_elapsed = time(NULL) - jcr->run_time;
37 +   int32_t job_elapsed = time(NULL) - jcr->run_time;
38  
39     if (job_elapsed <= 0) {
40        job_elapsed = 1;
41 Index: src/lib/message.c
42 ===================================================================
43 --- src/lib/message.c   (revision 8455)
44 +++ src/lib/message.c   (working copy)
45 @@ -780,8 +780,8 @@
46               case MD_DIRECTOR:
47                  Dmsg1(850, "DIRECTOR for following msg: %s", msg);
48                  if (jcr && jcr->dir_bsock && !jcr->dir_bsock->errors) {
49 -                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s",
50 -                      jcr->Job, type, mtime, msg);
51 +                   bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%lld %s",
52 +                      jcr->Job, type, (utime_t)mtime, msg);
53                  }
54                  break;
55               case MD_STDOUT: