The reason why mkbundle is not working is that for some reason
this constant expression is producing different code than the
-24 that it is supposed to.
What is odd is that the return value from the lseek system
call is the same, but yet, read fails with an end-of-file with
this value, and otherwise it passes.
With this call:
lseek (fd, -(16+sizeof(uint64_t)), SEEK_END)
strace displays:
lseek(0x3, 0xFFFFFFE8, 0x2) =
19375512 0
With this call:
lseek (fd, -24, SEEK_END)
strace displays:
lseek(0x3, 0xFFFFFFFFFFFFFFE8, 0x2) =
19375512 0
Now, while both results from lseek are the same, a subsequent read
with 24 bytes to read returns zero on the former case, and 24 on
the latter case.
int fd = open (program, O_RDONLY);
if (fd == -1)
return FALSE;
- if ((sigstart = lseek (fd, -(16+sizeof(uint64_t)), SEEK_END)) == -1)
+ if ((sigstart = lseek (fd, -24, SEEK_END)) == -1)
goto doclose;
if (read (fd, sigbuffer, sizeof (sigbuffer)) == -1)
goto doclose;