From 7b52a02f687276f774b715fdcb311bf1a43cb1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Tue, 10 Mar 1998 00:23:53 +0100 Subject: [PATCH] time() now updates current_time if no arguments are given. Rev: src/builtin_functions.c:1.79 --- src/builtin_functions.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index d08afa5276..48cbd6f646 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.78 1998/03/06 16:28:47 grubba Exp $"); +RCSID("$Id: builtin_functions.c,v 1.79 1998/03/09 23:23:53 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -663,10 +663,9 @@ void f_exit(INT32 args) void f_time(INT32 args) { pop_n_elems(args); - if(args) - push_int(current_time.tv_sec); - else - push_int((INT32)TIME(0)); + if(!args) + GETTIMEOFDAY(¤t_time); + push_int(current_time.tv_sec); } void f_crypt(INT32 args) -- GitLab