--- ../diffutils-2.8.7-orig/configure.ac 2004-04-13 15:55:43 +0900 +++ configure.ac 2007-12-23 21:39:10 +0900 @@ -68,6 +68,10 @@ XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" +AC_ARG_ENABLE(nanosecond-timestamps, + [AS_HELP_STRING([--disable-nanosecond-timestamps], + [disable nanosecond resolution in timestamps])], + [if test "no" = "$enableval"; then ac_cv_search_clock_gettime=no; fi]) # Check for clock_gettime and its library. Solaris puts it in -lrt or # -lposix4, but we don't want to link that library unless we have to. diff_saved_libs=$LIBS --- ../diffutils-2.8.7-orig/configure 2004-04-13 16:04:38 +0900 +++ configure 2007-12-23 21:43:34 +0900 @@ -864,6 +864,8 @@ --disable-largefile omit support for large files --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths + --disable-nanosecond-timestamps + disable nanosecond resolution in timestamps Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -17868,6 +17870,11 @@ XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT" +# Check whether --enable-nanosecond-timestamps was given. +if test "${enable_nanosecond_timestamps+set}" = set; then + enableval=$enable_nanosecond_timestamps; if test "no" = "$enableval"; then ac_cv_search_clock_gettime=no; fi +fi + # Check for clock_gettime and its library. Solaris puts it in -lrt or # -lposix4, but we don't want to link that library unless we have to. diff_saved_libs=$LIBS --- ../diffutils-2.8.7-orig/src/context.c 2004-04-12 16:44:35 +0900 +++ src/context.c 2007-12-23 21:39:10 +0900 @@ -62,7 +62,11 @@ { long int sec = inf->stat.st_mtime; verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); +#if HAVE_CLOCK_GETTIME sprintf (buf, "%ld.%.9d", sec, nsec); +#else + sprintf (buf, "%ld", sec); +#endif } fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf); } --- ../diffutils-2.8.7-orig/src/diff.c 2004-04-12 16:44:35 +0900 +++ src/diff.c 2007-12-23 21:42:10 +0900 @@ -620,7 +620,7 @@ if (output_style != OUTPUT_CONTEXT || hard_locale (LC_TIME)) { -#ifdef ST_MTIM_NSEC +#if defined(ST_MTIM_NSEC) && HAVE_CLOCK_GETTIME time_format = "%Y-%m-%d %H:%M:%S.%N %z"; #else time_format = "%Y-%m-%d %H:%M:%S %z";