[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix diff build on arm
From: |
Xin LI |
Subject: |
[PATCH] Fix diff build on arm |
Date: |
Sun, 17 Jun 2007 08:48:25 +0800 |
User-agent: |
Thunderbird 2.0.0.4 (X11/20070615) |
Hi,
I have just committed a changeset which will hopefully fix diffutils
build on FreeBSD/arm. The problem is that time_t on FreeBSD/arm is 64
bits while long int is 32 bits, therefore:
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
would fail because sec is defined as long int.
Please consider adopting the following patchset; credit goes to Olivier
Houchard <address@hidden> who gave me the patch:
Index: contrib/diff/src/context.c
===================================================================
RCS file: /cognet/ncvs/src/contrib/diff/src/context.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 context.c
--- contrib/diff/src/context.c 15 Jun 2007 07:06:07 -0000 1.1.1.1
+++ contrib/diff/src/context.c 16 Jun 2007 12:48:45 -0000
@@ -60,9 +60,9 @@ print_context_label (char const *mark,
int nsec = TIMESPEC_NS (inf->stat.st_mtim);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
- long int sec = inf->stat.st_mtime;
+ time_t sec = inf->stat.st_mtime;
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
- sprintf (buf, "%ld.%.9d", sec, nsec);
+ sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec);
}
fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
}
Cheers,
- [PATCH] Fix diff build on arm,
Xin LI <=