Fixed build warning "passing arg from incompatible pointer type"
authorTim Prouty <tim.prouty@isilon.com>
Tue, 7 Oct 2008 16:47:46 +0000 (09:47 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 15 Oct 2008 16:04:52 +0000 (18:04 +0200)
The fix explicitly makes the conversion from timeval to time_t using the
existing time utility functions.

Compiling modules/vfs_smb_traffic_analyzer.c
modules/vfs_smb_traffic_analyzer.c: In function `smb_traffic_analyzer_send_data':
modules/vfs_smb_traffic_analyzer.c:173: warning: passing arg 1 of `localtime' from incompatible pointer type
(cherry picked from commit a1dd4fc647340238eac10d411f531e37dba901b9)

source/modules/vfs_smb_traffic_analyzer.c

index ff617684957d7726c00eee2cb67e729f9e885fbe..9b4c1b3e25512c6f92b396ea80ce0bf526d50374 100644 (file)
@@ -156,6 +156,7 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
 {
        struct refcounted_sock *rf_sock = NULL;
        struct timeval tv;
+       time_t tv_sec;
        struct tm *tm = NULL;
        int seconds;
        char *str = NULL;
@@ -170,7 +171,8 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
        }
 
        GetTimeOfDay(&tv);
-       tm=localtime(&tv.tv_sec);
+       tv_sec = convert_timespec_to_time_t(convert_timeval_to_timespec(tv));
+       tm = localtime(&tv_sec);
        if (!tm) {
                return;
        }