From 07bd8db71458169c6bc7241b933357008ec81c7f Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Fri, 17 Jan 2014 08:53:59 +0100 Subject: [PATCH] marsadm: fix call of localtime() in old perl versions --- userspace/marsadm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/userspace/marsadm b/userspace/marsadm index 9af648a0..41b8216c 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -585,7 +585,8 @@ sub get_peers { sub __conv_tv { my ($tv_sec, $tv_nsec) = @_; - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($tv_sec); + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(int($tv_sec)); + return "$tv_sec.$tv_nsec" unless defined($sec); return sprintf("%04d-%02d-%02d %02d:%02d:%02d.%s", $year+1900, $mon + 1, $mday, $hour, $min, $sec, $tv_nsec); }