summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-09-20 10:53:45 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-09-20 10:53:45 -0700
commit4f920b71aae7ecb1470888b95c472c1f794486bc (patch)
treeaaef5e10bc61f3b23332fe5fe2b142ce88740261 /info.c
parentd66d376d204f07ccce36994c43f16365cfa1a5e5 (diff)
downloadsubsurface-4f920b71aae7ecb1470888b95c472c1f794486bc.tar.gz
dive-time widget: fix incorrect use of timestamp_t
I did a global search-and-replace to make all "time_t" users use the internal subsurface 64-bit "timestamp_t" type instead, but we have one case that still uses the system time functions: the use of "localtime()" in the dive_time_widget(). Everywhere else we always just use UTC for all our time handling, and we don't really ever care about the local timezone etc. However, for the dive time widget, we initialize the calendar widget to the current time, which obviously does want to take the local timezone into account, so there we end up using the whole system time handling code. So that one should continue to use time_t, even if it might have the year-2038 problem. We also don't care about the fact that it's not thread-safe, since this is just initializing the widget which definitely doesn't happen threaded. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/info.c b/info.c
index 16149cb02..40e0af278 100644
--- a/info.c
+++ b/info.c
@@ -727,7 +727,7 @@ static timestamp_t dive_time_widget(struct dive *dive)
utc_mkdate(when, &tm);
time = &tm;
} else {
- timestamp_t now;
+ time_t now;
struct timeval tv;
gettimeofday(&tv, NULL);
now = tv.tv_sec;