bug-gnulib
[Top][All Lists]
Advanced

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

Re: FYI, utimens was missing a dependency on timespec


From: Eric Blake
Subject: Re: FYI, utimens was missing a dependency on timespec
Date: Fri, 23 Feb 2007 18:24:00 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> No.  Otherwise, gnulib's "time.h" replacement becomes mandatory,
> and encourages gnulib-using applications to use functions
> that are not standard.

Agreed.

> 
> > Or do we keep the timespec module, which both coreutils and tar
> > explicitly request, as an add-on module not required by any other gnulib 
module?
> 
> So, the timespec module provides something useful and nonstandard,
> and we should keep it.
> 
> Just make stat-time depend on timespec, after all?

No, because stat-time didn't use any of the added features of timespec.h.  
Here's what I'm checking in - if all a module needed was struct timespec, it 
should depend on <time.h>; if it uses the extension of gettime, it depends on 
timespec.h (possibly indirectly through the gettime module).

2007-02-23  Eric Blake  <address@hidden>

        * lib/getdate.h (includes):  Include <time.h>, not "timespec.h".
        * lib/stat-time.h (includes): Likewise.
        * lib/utimecmp.c (includes): Likewise.
        * lib/utimens.h (includes): Likewise.
        * lib/getdate.y (includes): Also include "timespec.h" for use
        internal to the module.
        * modules/utimens (Depends-on): Revert yesterday's patch.
        * modules/nanosleep (Depends-on): Add missing dependency.


Index: lib/getdate.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/getdate.h,v
retrieving revision 1.13
diff -u -r1.13 getdate.h
--- lib/getdate.h       19 Sep 2005 17:28:14 -0000      1.13
+++ lib/getdate.h       23 Feb 2007 18:14:43 -0000
@@ -1,6 +1,7 @@
 /* Parse a string into an internal time stamp.
 
-   Copyright (C) 1995, 1997, 1998, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997, 1998, 2003, 2004, 2007 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,6 +18,6 @@
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <stdbool.h>
-#include "timespec.h"
+#include <time.h>
 
 bool get_date (struct timespec *, char const *, struct timespec const *);
Index: lib/getdate.y
===================================================================
RCS file: /sources/gnulib/gnulib/lib/getdate.y,v
retrieving revision 1.107
diff -u -r1.107 getdate.y
--- lib/getdate.y       24 Oct 2006 19:54:55 -0000      1.107
+++ lib/getdate.y       23 Feb 2007 18:14:43 -0000
@@ -1,7 +1,7 @@
 %{
 /* Parse a string into an internal time stamp.
 
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -35,6 +35,7 @@
 #include <config.h>
 
 #include "getdate.h"
+#include "timespec.h"
 
 /* There's no need to extend the stack, so there's no need to involve
    alloca.  */
Index: lib/stat-time.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/stat-time.h,v
retrieving revision 1.3
diff -u -r1.3 stat-time.h
--- lib/stat-time.h     7 Dec 2005 18:18:33 -0000       1.3
+++ lib/stat-time.h     23 Feb 2007 18:14:43 -0000
@@ -1,6 +1,6 @@
 /* stat-related time functions.
 
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 #ifndef STAT_TIME_H
 #define STAT_TIME_H 1
 
-#include "timespec.h"
+#include <time.h>
 
 /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
    struct timespec, if available.  If not, then STAT_TIMESPEC_NS (ST,
Index: lib/utimecmp.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/utimecmp.c,v
retrieving revision 1.9
diff -u -r1.9 utimecmp.c
--- lib/utimecmp.c      5 Oct 2006 21:23:21 -0000       1.9
+++ lib/utimecmp.c      23 Feb 2007 18:14:43 -0000
@@ -1,6 +1,6 @@
 /* utimecmp.c -- compare file time stamps
 
-   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -26,10 +26,10 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <time.h>
 #include "hash.h"
 #include "intprops.h"
 #include "stat-time.h"
-#include "timespec.h"
 #include "utimens.h"
 #include "verify.h"
 #include "xalloc.h"
Index: lib/utimens.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/utimens.h,v
retrieving revision 1.2
diff -u -r1.2 utimens.h
--- lib/utimens.h       23 Nov 2004 20:59:50 -0000      1.2
+++ lib/utimens.h       23 Feb 2007 18:14:43 -0000
@@ -1,3 +1,3 @@
-#include "timespec.h"
+#include <time.h>
 int futimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
Index: modules/nanosleep
===================================================================
RCS file: /sources/gnulib/gnulib/modules/nanosleep,v
retrieving revision 1.14
diff -u -r1.14 nanosleep
--- modules/nanosleep   12 Feb 2007 18:49:19 -0000      1.14
+++ modules/nanosleep   23 Feb 2007 18:14:43 -0000
@@ -8,6 +8,7 @@
 Depends-on:
 clock-time
 extensions
+gettime
 stdbool
 sys_time
 time
Index: modules/utimens
===================================================================
RCS file: /sources/gnulib/gnulib/modules/utimens,v
retrieving revision 1.10
diff -u -r1.10 utimens
--- modules/utimens     22 Feb 2007 21:27:01 -0000      1.10
+++ modules/utimens     23 Feb 2007 18:14:43 -0000
@@ -11,7 +11,6 @@
 Depends-on:
 sys_time
 time
-timespec
 
 configure.ac:
 gl_UTIMENS






reply via email to

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