[File] Error on 32bit for file 5.45

Dr. Werner Fink werner at suse.de
Mon Jul 31 07:51:50 UTC 2023


On 2023/07/28 10:38:11 -0400, Christos Zoulas wrote:
> How about this?
> 
> christos
> 
> Index: file.h
> ===================================================================
> RCS file: /p/file/cvsroot/file/src/file.h,v
> retrieving revision 1.247
> diff -u -p -u -r1.247 file.h
> --- file.h      27 Jul 2023 19:40:22 -0000      1.247
> +++ file.h      28 Jul 2023 14:37:17 -0000
> @@ -159,9 +159,11 @@
>  /*
>   * Dec 31, 23:59:59 9999
>   * we need to make sure that we don't exceed 9999 because some libc
> - * implementations like muslc crash otherwise
> + * implementations like muslc crash otherwise. If you are unlucky
> + * to be running on a system with a 32 bit time_t, then it is even less.
>   */
> -#define        MAX_CTIME       CAST(time_t, 0x3afff487cfULL)
> +#define        MAX_CTIME \
> +    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
> 
>  #define FILE_BADSIZE CAST(size_t, ~0ul)
>  #define MAXDESC        64              /* max len of text description/MIME type */

Indeed that works also ... for glibc based systems or if autoconf 2.72c and
newer I'd like to suggest the extended and attached patch as this enables
wide time_t on 32bt platforms if available.

Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.45-type_t.dif
Type: text/x-patch
Size: 1412 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230731/3d782159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 894 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230731/3d782159/attachment-0001.asc>


More information about the File mailing list