From 73839d1a43dce7cac4e7ae68d9fb334c29c6d3e5 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Thu, 3 Aug 2006 14:11:23 +0200
Subject: [PATCH] Use _utime on Windows.

Rev: src/modules/system/configure.in:1.77
Rev: src/modules/system/system.c:1.180
---
 src/modules/system/configure.in | 4 ++--
 src/modules/system/system.c     | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/modules/system/configure.in b/src/modules/system/configure.in
index d3174d40e4..b4e0fb2623 100644
--- a/src/modules/system/configure.in
+++ b/src/modules/system/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.76 2006/07/01 23:53:19 mast Exp $
+# $Id: configure.in,v 1.77 2006/08/03 12:11:23 mast Exp $
 AC_INIT(system.c)
 AC_CONFIG_HEADER(system_machine.h)
 
@@ -94,7 +94,7 @@ AC_HAVE_FUNCS(syslog link symlink readlink resolvepath realpath chown \
 	chroot fchroot uname sysinfo gethostname gethostbyname getservbyname \
         getgrnam_r getgrent_r getgrgid_r \
         getpwnam_r getpwent_r getpwuid_r \
-        getspnam_r innetgr utime sleep usleep nanosleep \
+	getspnam_r innetgr utime _utime sleep usleep nanosleep \
         getrlimit setrlimit setproctitle \
         setitimer getitimer mmap munmap \
 	gettimeofday settimeofday prctl inet_ntoa inet_ntop getaddrinfo)
diff --git a/src/modules/system/system.c b/src/modules/system/system.c
index 21d2179563..df6a3833e8 100644
--- a/src/modules/system/system.c
+++ b/src/modules/system/system.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: system.c,v 1.179 2006/04/19 14:29:54 nilsson Exp $
+|| $Id: system.c,v 1.180 2006/08/03 12:11:23 mast Exp $
 */
 
 /*
@@ -522,7 +522,7 @@ void f_chown(INT32 args)
 }
 #endif
 
-#ifdef HAVE_UTIME
+#if defined (HAVE_UTIME) || defined (HAVE__UTIME)
 /*! @decl void utime(string path, int atime, int mtime)
  *!
  *! Set the last access time and last modification time for the
@@ -555,7 +555,11 @@ void f_utime(INT32 args)
   b.modtime=mtime;
   do {
     THREADS_ALLOW_UID();
+#ifdef HAVE__UTIME
+    err = _utime (path, &b);
+#else
     err = utime(path, &b);
+#endif
     THREADS_DISALLOW_UID();
     if (err >= 0 || errno != EINTR) break;
     check_threads_etc();
-- 
GitLab