guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-6-172-gad


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-6-172-gadfb428
Date: Mon, 18 Jan 2010 23:29:34 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=adfb42846617f6ed11cbe6ca9f0256e48a0cbb49

The branch, master has been updated
       via  adfb42846617f6ed11cbe6ca9f0256e48a0cbb49 (commit)
      from  5b6b22e8ead58068d9085bc72d2a719f7cbfd3b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit adfb42846617f6ed11cbe6ca9f0256e48a0cbb49
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jan 19 00:23:33 2010 +0100

    Fix use of utimensat(2).
    
    * libguile/posix.c (scm_utime): Use "#ifdef HAVE_UTIMENSAT", not "#if
      HAVE_UTIMENSAT".  Fix GCC warning around call to utimensat(2):
      "passing argument 3 of 'utimensat' from incompatible pointer type".
    
    * test-suite/tests/posix.test ("utime"): New test prefix.

-----------------------------------------------------------------------

Summary of changes:
 libguile/posix.c            |   10 +++++-----
 test-suite/tests/posix.test |   21 ++++++++++++++++++++-
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/libguile/posix.c b/libguile/posix.c
index f386fdf..73921a2 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2005, 
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2005, 
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -1399,7 +1399,7 @@ SCM_DEFINE (scm_utime, "utime", 1, 5, 0,
   
   if (SCM_UNBNDP (actime))
     {
-#if HAVE_UTIMENSAT
+#ifdef HAVE_UTIMENSAT
       atim_sec = 0;
       atim_nsec = UTIME_NOW;
 #else
@@ -1418,7 +1418,7 @@ SCM_DEFINE (scm_utime, "utime", 1, 5, 0,
   
   if (SCM_UNBNDP (modtime))
     {
-#if HAVE_UTIMENSAT
+#ifdef HAVE_UTIMENSAT
       mtim_sec = 0;
       mtim_nsec = UTIME_NOW;
 #else
@@ -1440,7 +1440,7 @@ SCM_DEFINE (scm_utime, "utime", 1, 5, 0,
   else
     f = SCM_NUM2INT (6, flags);
 
-#if HAVE_UTIMENSAT
+#ifdef HAVE_UTIMENSAT
   {
     struct timespec times[2];
     times[0].tv_sec = atim_sec;
@@ -1449,7 +1449,7 @@ SCM_DEFINE (scm_utime, "utime", 1, 5, 0,
     times[1].tv_nsec = mtim_nsec;
 
     STRING_SYSCALL (pathname, c_pathname,
-                    rv = utimensat (AT_FDCWD, c_pathname, &times, f));
+                    rv = utimensat (AT_FDCWD, c_pathname, times, f));
   }
 #else
   {
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index 06b70ba..6cfecee 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -1,6 +1,6 @@
 ;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
 ;;;;
-;;;; Copyright 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+;;;; Copyright 2003, 2004, 2006, 2007, 2010 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -160,4 +160,23 @@
           (throw 'unsupported)
           (ttyname file)))))
 
+;;
+;; utimes
+;;
+
+(with-test-prefix "utime"
 
+  (pass-if "valid argument (second resolution)"
+    (let ((file "posix.test-utime"))
+      (dynamic-wind
+        (lambda ()
+          (close-port (open-output-file file)))
+        (lambda ()
+          (let* ((accessed (+ (current-time) 3600))
+                 (modified (- accessed 1000)))
+            (utime file accessed modified)
+            (let ((info (stat file)))
+              (and (= (stat:atime info) accessed)
+                   (= (stat:mtime info) modified)))))
+        (lambda ()
+          (delete-file file))))))


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]