diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-04 21:58:46 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-08-04 21:58:46 +0000 |
commit | 0e591504c8a2304227ff02697498d008c745fef4 (patch) | |
tree | 0fd34cc0af61a881f15be1cf6c8a66db8f2970fd /lib/fts.c | |
parent | fade486c6054a367e4376747118ee19eea738b61 (diff) | |
download | coreutils-0e591504c8a2304227ff02697498d008c745fef4.tar.xz |
(LONGEST_MODIFIER): New macro.
(PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro.
(find_matching_ancestor): Use it for dev_t and ino_t.
Diffstat (limited to 'lib/fts.c')
-rw-r--r-- | lib/fts.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -76,6 +76,17 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #if HAVE_STDINT_H # include <stdint.h> #endif +#if ULONG_MAX < ULLONG_MAX +# define LONGEST_MODIFIER "ll" +#else +# define LONGEST_MODIFIER "l" +#endif +#if PRI_MACROS_BROKEN +# undef PRIuMAX +#endif +#ifndef PRIuMAX +# define PRIuMAX LONGEST_MODIFIER "u" +#endif #if defined _LIBC # include <dirent.h> @@ -1103,13 +1114,13 @@ find_matching_ancestor (FTSENT const *e_curr, struct Active_dir const *ad) printf ("active dirs:\n"); for (ent = e_curr; ent->fts_level >= FTS_ROOTLEVEL; ent = ent->fts_parent) - printf (" %s(%lu/%lu) to %s(%lu/%lu)...\n", + printf (" %s(%"PRIuMAX"/%"PRIuMAX") to %s(%"PRIuMAX"/%"PRIuMAX")...\n", ad->fts_ent->fts_accpath, - (unsigned long int) ad->dev, - (unsigned long int) ad->ino, + (uintmax_t) ad->dev, + (uintmax_t) ad->ino, ent->fts_accpath, - (unsigned long int) ent->fts_statp->st_dev, - (unsigned long int) ent->fts_statp->st_ino); + (uintmax_t) ent->fts_statp->st_dev, + (uintmax_t) ent->fts_statp->st_ino); } void |