--- ../diffutils-2.8.1-orig/configure.ac 2002-04-06 05:37:31 +0900 +++ configure.ac 2007-12-23 21:35:27 +0900 @@ -94,6 +94,10 @@ jm_PREREQ_TEMPNAME jm_AC_PREREQ_XSTRTOUMAX +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.1-orig/configure 2002-04-06 06:48:26 +0900 +++ configure 2007-12-23 21:36:25 +0900 @@ -845,6 +845,8 @@ --enable-dependency-tracking Do not reject slow dependency extractors --disable-largefile omit support for large files --disable-nls do not use Native Language Support + --disable-nanosecond-timestamps + disable nanosecond resolution in timestamps Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -13381,6 +13383,11 @@ esac +# 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.1-orig/src/context.c 2002-02-28 13:22:42 +0900 +++ src/context.c 2007-12-23 21:25:21 +0900 @@ -63,7 +63,11 @@ { long 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.1-orig/src/diff.c 2002-03-24 16:35:28 +0900 +++ src/diff.c 2007-12-23 21:25:21 +0900 @@ -607,7 +607,11 @@ } if (output_style != OUTPUT_CONTEXT || hard_locale (LC_TIME)) +#if HAVE_CLOCK_GETTIME time_format = "%Y-%m-%d %H:%M:%S.%N %z"; +#else + time_format = "%Y-%m-%d %H:%M:%S %z"; +#endif else { /* See POSIX 1003.1-2001 for this format. */