[File] Big endianess problem on s390x?
Dr. Werner Fink
werner at suse.de
Tue May 19 02:57:15 EDT 2026
On 2026/05/18 11:15:40 -0400, Christos Zoulas wrote:
> Is this after the most recent change that includes byte swapping?
>
AFAICS there is no change in src/funcs.c for getxvalue() but
in file_parse_guid() in the fresh pulled git repro from github:
@@ -943,19 +931,15 @@ file_parse_guid(const char *s, uint64_t
!getxvalue(&g->data4[6], s + 8, 2) ||
!getxvalue(&g->data4[7], s + 10, 2))
return -1;
+
+ if (file_bigendian()) {
+ g->data1 = file_swap4(g->data1);
+ g->data2 = file_swap2(g->data2);
+ g->data3 = file_swap2(g->data3);
+
+ }
return 0;
}
this likely does the same job as my patch .. I'll verify this.
It is possible to solve this without byte swapping.
This would change getxvalue() and file_parse_guid() to use bytes
as shown in the attachment.
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.47-s390x-complex.patch
Type: text/x-patch
Size: 2448 bytes
Desc: not available
URL: <http://mailman.astron.com/pipermail/file/attachments/20260519/ae7dfcfa/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: <http://mailman.astron.com/pipermail/file/attachments/20260519/ae7dfcfa/attachment-0001.asc>
More information about the File
mailing list