From c0ef93761482a9f3673fc969816a45eec82c5eac Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 22 May 2001 20:41:52 +0000 Subject: [PATCH] fix datime/1, system/2 and declaration for p_stream. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@40 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/iopreds.c | 4 ++-- library/system.yap | 2 +- library/system/sys.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C/iopreds.c b/C/iopreds.c index e7069afa9..64a351635 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -4522,8 +4522,8 @@ StreamToFileNo(Term t) } } -int -p_stream(Term t) +static Int +p_stream(void) { Term in = Deref(ARG1); if (IsVarTerm(in)) diff --git a/library/system.yap b/library/system.yap index 22f9acc10..caed07b8a 100644 --- a/library/system.yap +++ b/library/system.yap @@ -282,7 +282,7 @@ shell(Command, Status) :- system(Command, Status) :- G = system(Command, Status), check_command(Command, G), - do_system(Status, Status). + do_system(Command, Status). sleep(Interval) :- var(Interval), !, throw(error(instantiation_error,sleep(Interval))). diff --git a/library/system/sys.c b/library/system/sys.c index 8854048ec..4037e7b27 100644 --- a/library/system/sys.c +++ b/library/system/sys.c @@ -80,8 +80,8 @@ datime(void) if (loc == NULL) { return(unify(ARG2, MkIntTerm(errno))); } - out[0] = MkIntTerm(loc->tm_year); - out[1] = MkIntTerm(loc->tm_mon); + out[0] = MkIntTerm(1900+loc->tm_year); + out[1] = MkIntTerm(1+loc->tm_mon); out[2] = MkIntTerm(loc->tm_mday); out[3] = MkIntTerm(loc->tm_hour); out[4] = MkIntTerm(loc->tm_min); @@ -389,7 +389,7 @@ shell(void) /* execute a command as a detached process */ static int -p_system(void) +do_system(void) { char *command = AtomName(AtomOfTerm(ARG1)); int sys = system(command); @@ -543,7 +543,7 @@ init_sys(void) UserCPredicate("p_environ", p_environ, 2); UserCPredicate("exec_command", execute_command, 6); UserCPredicate("do_shell", shell, 2); - UserCPredicate("do_system", p_system, 2); + UserCPredicate("do_system", do_system, 2); UserCPredicate("popen", p_popen, 4); UserCPredicate("wait", p_wait, 3); UserCPredicate("host_name", host_name, 2);