From 2c7110f2230f4bf73f74fe3721958fe16a58e8ba Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 16 Oct 2006 23:39:20 +0000
Subject: [PATCH] * lib/fsusage.c (PROPAGATE_ALL_ONES): Don't assume uintmax_t
 is at least as wide as intmax_t.

---
 ChangeLog     | 5 +++++
 lib/fsusage.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index addf6ef8d7..9a5beab588 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* lib/fsusage.c (PROPAGATE_ALL_ONES): Don't assume uintmax_t is
+	at least as wide as intmax_t.
+
 2006-10-16  Alexandre Duret-Lutz  <adl@gnu.org>
 
 	(Imported from Automake.)
diff --git a/lib/fsusage.c b/lib/fsusage.c
index c9721ca7ee..7d84a9ff74 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -61,11 +61,11 @@
    a uintmax_t value that is all 1 bits if X is all 1 bits, even if X
    is unsigned and narrower than uintmax_t.  */
 #define PROPAGATE_ALL_ONES(x) \
-  ((sizeof (x) < sizeof (uintmax_t) \
+  ((sizeof (x) != sizeof (uintmax_t) \
     && (~ (x) == (sizeof (x) < sizeof (int) \
 		  ? - (1 << (sizeof (x) * CHAR_BIT)) \
 		  : 0))) \
-   ? UINTMAX_MAX : (x))
+   ? UINTMAX_MAX : (uintmax_t) (x))
 
 /* Extract the top bit of X as an uintmax_t value.  */
 #define EXTRACT_TOP_BIT(x) ((x) \
-- 
2.39.5