summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-07 10:21:47 -0500
committerDan McGee <dan@archlinux.org>2011-10-12 14:01:25 -0500
commit5f3629bea0d4beb79c6092086b46f3d73643c76d (patch)
tree77fec7e0aa39d6bca0309d0043a68d7a9698d237 /src
parent759f435fb91a3abf64a422b53f939a774332cd8a (diff)
downloadpacman-5f3629bea0d4beb79c6092086b46f3d73643c76d.tar.xz
Introduce alpm_time_t type
This will always be a 64-bit signed integer rather than the variable length time_t type. Dates beyond 2038 should be fully supported in the library; the frontend still lags behind because 32-bit platforms provide no localtime64() or equivalent function to convert from an epoch value to a broken down time structure. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c1
-rw-r--r--src/pacman/package.c5
-rw-r--r--src/pacman/util.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 3ba07b0c..f62d4449 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <sys/time.h>
#include <sys/types.h> /* off_t */
+#include <time.h>
#include <unistd.h>
#include <wchar.h>
#include <limits.h> /* UINT_MAX */
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 6a312f9a..84696280 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -26,6 +26,7 @@
#include <unistd.h>
#include <limits.h>
#include <errno.h>
+#include <time.h>
#include <alpm.h>
#include <alpm_list.h>
@@ -74,11 +75,11 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
from = alpm_pkg_get_origin(pkg);
/* set variables here, do all output below */
- bdate = alpm_pkg_get_builddate(pkg);
+ bdate = (time_t)alpm_pkg_get_builddate(pkg);
if(bdate) {
strftime(bdatestr, 50, "%c", localtime(&bdate));
}
- idate = alpm_pkg_get_installdate(pkg);
+ idate = (time_t)alpm_pkg_get_installdate(pkg);
if(idate) {
strftime(idatestr, 50, "%c", localtime(&idate));
}
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 79fb54dc..ae9f881a 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -23,7 +23,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/time.h>
+#include <time.h>
#include <stdio.h>
#include <stdlib.h>