Changeset 40 for trunk/src/sh_hash.c


Ignore:
Timestamp:
May 31, 2006, 9:38:30 PM (18 years ago)
Author:
rainer
Message:

Fix for tickets #13, #14, #15, #16, #17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r34 r40  
    19981998  p.linkmode    = (UINT32) buf->linkmode;
    19991999  p.hardlinks   = (UINT32) buf->hardlinks;
     2000  p.dev   = (UINT64) buf->dev;
     2001  p.rdev  = (UINT64) buf->rdev;
    20002002  p.mode  = (UINT32) buf->mode;
    20012003  p.ino   = (UINT32) buf->ino;
     
    20592061#endif
    20602062
    2061 #ifndef PRIi64
    2062 #define PRIi64 "lld"
     2063#ifndef PRIu64
     2064#ifdef  HAVE_LONG_32
     2065#define PRIu64 "llu"
     2066#else
     2067#define PRIu64 "lu"
     2068#endif
    20632069#endif
    20642070
     
    20722078#ifdef SH_USE_XML
    20732079  sl_snprintf(form_rval, 80, _("%s%s%s%s%s"),
    2074               _("size_old=\"%"), PRIi64, _("\" size_new=\"%"), PRIi64, "\" ");
     2080              _("size_old=\"%"), PRIu64, _("\" size_new=\"%"), PRIu64, "\" ");
    20752081#else
    20762082  sl_snprintf(form_rval, 80, _("%s%s%s%s%s"),
    2077               _("size_old=<%"), PRIi64, _(">, size_new=<%"), PRIi64, ">, ");
     2083              _("size_old=<%"), PRIu64, _(">, size_new=<%"), PRIu64, ">, ");
    20782084#endif
    20792085
     
    21242130
    21252131  if (is_new)
    2126     format = _("hardlinks_new=\"%ld\" ");
    2127   else
    2128     format = _("hardlinks_old=\"%ld\" ");
     2132    format = _("hardlinks_new=\"%lu\" ");
     2133  else
     2134    format = _("hardlinks_old=\"%lu\" ");
    21292135  sl_snprintf(tmp, SH_BUFSIZE, format,
    21302136              (unsigned long) theFile->hardlinks);
     
    21332139
    21342140  if (is_new)
    2135     format = _("idevice_new=\"%ld\" ");
    2136   else
    2137     format = _("idevice_old=\"%ld\" ");
     2141    format = _("idevice_new=\"%lu\" ");
     2142  else
     2143    format = _("idevice_old=\"%lu\" ");
    21382144  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
    21392145  sl_strlcat(msg, tmp, SH_BUFSIZE);
     
    21412147
    21422148  if (is_new)
    2143     format = _("inode_new=\"%ld\" ");
    2144   else
    2145     format = _("inode_old=\"%ld\" ");
     2149    format = _("inode_new=\"%lu\" ");
     2150  else
     2151    format = _("inode_old=\"%lu\" ");
    21462152  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
    21472153  sl_strlcat(msg, tmp, SH_BUFSIZE);
     2154
     2155  /*
     2156   * also report device for prelude
     2157   */
     2158#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
     2159  if (is_new)
     2160    format = _("dev_new=\"%lu,%lu\" ");
     2161  else
     2162    format = _("dev_old=\"%lu,%lu\" ");
     2163  sl_snprintf(tmp, SH_BUFSIZE, format,               
     2164              (unsigned long) major(theFile->dev),
     2165              (unsigned long) minor(theFile->dev));
     2166  sl_strlcat(msg, tmp, SH_BUFSIZE);
     2167#endif
    21482168
    21492169
     
    22612281
    22622282  if (is_new)
    2263     format = _("hardlinks_new=<%ld>, ");
    2264   else
    2265     format = _("hardlinks_old=<%ld>, ");
     2283    format = _("hardlinks_new=<%lu>, ");
     2284  else
     2285    format = _("hardlinks_old=<%lu>, ");
    22662286  sl_snprintf(tmp, SH_BUFSIZE, format,
    22672287              (unsigned long) theFile->hardlinks);
     
    22702290
    22712291  if (is_new)
    2272     format = _("idevice_new=<%ld>, ");
    2273   else
    2274     format = _("idevice_old=<%ld>, ");
     2292    format = _("idevice_new=<%lu>, ");
     2293  else
     2294    format = _("idevice_old=<%lu>, ");
    22752295  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
    22762296  sl_strlcat(msg, tmp, SH_BUFSIZE);
     
    22782298
    22792299  if (is_new)
    2280     format = _("inode_new=<%ld>, ");
    2281   else
    2282     format = _("inode_old=<%ld>, ");
     2300    format = _("inode_new=<%lu>, ");
     2301  else
     2302    format = _("inode_old=<%lu>, ");
    22832303  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
    22842304  sl_strlcat(msg, tmp, SH_BUFSIZE);
    22852305
     2306
     2307  /*
     2308   * also report device for prelude
     2309   */
     2310#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
     2311  if (is_new)
     2312    format = _("dev_new=<%lu,%lu>, ");
     2313  else
     2314    format = _("dev_old=<%lu,%lu>, ");
     2315  sl_snprintf(tmp, SH_BUFSIZE, format,               
     2316              (unsigned long) major(theFile->dev),
     2317              (unsigned long) minor(theFile->dev));
     2318  sl_strlcat(msg, tmp, SH_BUFSIZE);
     2319#endif
    22862320
    22872321  if (is_new)
     
    27292763          sl_snprintf(tmp, SH_BUFSIZE,
    27302764#ifdef SH_USE_XML
    2731                       _("hardlinks_old=\"%ld\" hardlinks_new=\"%ld\" "),
    2732 #else
    2733                       _("hardlinks_old=<%ld>, hardlinks_new=<%ld>, "),
     2765                      _("hardlinks_old=\"%lu\" hardlinks_new=\"%lu\" "),
     2766#else
     2767                      _("hardlinks_old=<%lu>, hardlinks_new=<%lu>, "),
    27342768#endif
    27352769                      (unsigned long) p->theFile.hardlinks,
     
    27462780          sl_snprintf(tmp, SH_BUFSIZE,
    27472781#ifdef SH_USE_XML
    2748                       _("device_old=\"%ld,%ld\" device_new=\"%ld,%ld\" idevice_old=\"%ld\" idevice_new=\"%ld\" "),
    2749 #else
    2750                       _("device_old=<%ld,%ld>, device_new=<%ld,%ld>, "),
     2782                      _("device_old=\"%lu,%lu\" device_new=\"%lu,%lu\" idevice_old=\"%lu\" idevice_new=\"%lu\" "),
     2783#else
     2784                      _("device_old=<%lu,%lu>, device_new=<%lu,%lu>, "),
    27512785#endif
    27522786                      (unsigned long) major(p->theFile.rdev),
     
    27702804          sl_snprintf(tmp, SH_BUFSIZE,
    27712805#ifdef SH_USE_XML
    2772                       _("inode_old=\"%ld\" inode_new=\"%ld\" "),
    2773 #else
    2774                       _("inode_old=<%ld>, inode_new=<%ld>, "),
     2806                      _("inode_old=\"%lu\" inode_new=\"%lu\" "),
     2807#else
     2808                      _("inode_old=<%lu>, inode_new=<%lu>, "),
    27752809#endif
    27762810                      (unsigned long) p->theFile.ino,
     
    27792813#ifdef REPLACE_OLD
    27802814          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
    2781             p->theFile.ino = theFile->ino;
    2782 #endif
    2783         }
     2815            {
     2816              p->theFile.ino = theFile->ino;
     2817              p->theFile.dev = theFile->dev;
     2818            }
     2819#endif
     2820        }
     2821
     2822
     2823      /*
     2824       * also report device for prelude
     2825       */
     2826#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
     2827      if ((modi_mask & MODI_INO) != 0)
     2828        {
     2829          sl_snprintf(tmp, SH_BUFSIZE,
     2830#ifdef SH_USE_XML
     2831                      _("dev_old=\"%lu,%lu\" dev_new=\"%lu,%lu\" "),
     2832#else
     2833                      _("dev_old=<%lu,%lu>, dev_new=<%lu,%lu>, "),
     2834#endif
     2835                      (unsigned long) major(p->theFile.dev),
     2836                      (unsigned long) minor(p->theFile.dev),
     2837                      (unsigned long) major(theFile->dev),
     2838                      (unsigned long) minor(theFile->dev)
     2839                      );
     2840          sl_strlcat(msg, tmp, SH_BUFSIZE);
     2841#ifdef REPLACE_OLD
     2842          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     2843            p->theFile.dev = theFile->dev;
     2844#endif
     2845        }
     2846#endif
    27842847
    27852848      if (   ((modi_mask & MODI_USR) != 0)
     
    27902853        {
    27912854#ifdef SH_USE_XML
    2792           sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
    2793 #else
    2794           sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=<%s>, owner_new=<%s>, "),
    2795 #endif
    2796                       p->theFile.c_owner, theFile->c_owner
    2797 #ifdef SH_USE_XML
    2798                       , (long) p->theFile.owner, (long) theFile->owner
    2799 #endif
     2855          sl_snprintf(tmp, SH_BUFSIZE,
     2856                      _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
     2857#else
     2858          sl_snprintf(tmp, SH_BUFSIZE,
     2859                      _("owner_old=<%s>, owner_new=<%s>, iowner_old=<%ld>, iowner_new=<%ld>, "),
     2860#endif
     2861                      p->theFile.c_owner, theFile->c_owner,
     2862                      (long) p->theFile.owner, (long) theFile->owner
    28002863                      );
    28012864          sl_strlcat(msg, tmp, SH_BUFSIZE);
     
    28182881        {
    28192882#ifdef SH_USE_XML
    2820           sl_snprintf(tmp, SH_BUFSIZE, _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
     2883          sl_snprintf(tmp, SH_BUFSIZE,
     2884                      _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
    28212885                      p->theFile.c_group, theFile->c_group,
    28222886                      (long) p->theFile.group, (long) theFile->group);
    28232887#else
    2824           sl_snprintf(tmp, SH_BUFSIZE, _("group_old=<%s>, group_new=<%s>, "),
    2825                       p->theFile.c_group, theFile->c_group);
     2888          sl_snprintf(tmp, SH_BUFSIZE,
     2889                      _("group_old=<%s>, group_new=<%s>, igroup_old=<%ld>, igroup_new=<%ld>, "),
     2890                      p->theFile.c_group, theFile->c_group,
     2891                      (long) p->theFile.group, (long) theFile->group);
    28262892#endif
    28272893
     
    31533219  if (ListWithDelimiter == S_TRUE)
    31543220    {
    3155       printf(_("%7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
    3156              (unsigned long) p->theFile.ino,
     3221      printf(_("%7ld, %7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
     3222             (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
    31573223             p->theFile.c_mode, (int) p->theFile.mode,
    31583224             p->theFile.c_attributes, (int) p->theFile.attributes,
     
    31633229  else
    31643230    {
    3165       printf(_("%7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
    3166              (unsigned long) p->theFile.ino,
     3231      printf(_("%7ld %7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
     3232             (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
    31673233             p->theFile.c_mode, (int) p->theFile.mode,
    31683234             p->theFile.c_attributes, (int) p->theFile.attributes,
     
    31733239
    31743240  if ('c' == p->theFile.c_mode[0] || 'b' == p->theFile.c_mode[0])
    3175     sl_snprintf(str, 80, "%"PRIi64, p->theFile.rdev);
    3176   else
    3177     sl_snprintf(str, 80, "%"PRIi64, p->theFile.size);
     3241    sl_snprintf(str, 80, "%"PRIu64, p->theFile.rdev);
     3242  else
     3243    sl_snprintf(str, 80, "%"PRIu64, p->theFile.size);
    31783244
    31793245  printf( _(" %8s"), str);
Note: See TracChangeset for help on using the changeset viewer.