From 48857bb990295b541d62ab59ad67dbab76cc1845 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 16 Jul 2004 18:33:19 +0000 Subject: [PATCH] workaround uptime issue on 5.x --- src/os/aix/aix_sigar.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index ce9e3aa9..4e555f92 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -449,7 +449,18 @@ static int boot_time_v5(int fd, time_t *time) } } while (data.ut_type != BOOT_TIME); - *time = data.ut_time; + if (data.ut_time != 0) { + *time = data.ut_time; + } + else { + /* XXX: dunno wtf is going on here. + * this exact code above works as expected + * in a standalone program. + * sizeof(utmp_v5) is the same if compiled on 4.3 + * or 5.2, this workaround hack will have todo for now. + */ + *time = data.__time_t_space; + } return SIGAR_OK; }