diff options
author | Luc Maranget <luc.maranget@inria.fr> | 2014-03-13 15:03:16 +0000 |
---|---|---|
committer | Luc Maranget <luc.maranget@inria.fr> | 2014-03-13 15:03:16 +0000 |
commit | 1338d73c180d22cd2fd2abc5b46554a56f66b1f5 (patch) | |
tree | 1d7171e373a49abdbac5bc790f896aadbca27718 /byterun/startup.c | |
parent | 18e6a3781be059367bfff403aa8a41e9dc200844 (diff) | |
download | ocaml-jo401.tar.gz |
Merge jo401 w.r.t ocaml/4.01 from 13776 to 14115jo401
Plus ld.conf changes
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/jo401@14458 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/startup.c')
-rw-r--r-- | byterun/startup.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/byterun/startup.c b/byterun/startup.c index be55f484eb..7b9aad46fe 100644 --- a/byterun/startup.c +++ b/byterun/startup.c @@ -88,7 +88,8 @@ static void fixup_endianness_trailer(uint32 * p) static int read_trailer(int fd, struct exec_trailer *trail) { - lseek(fd, (long) -TRAILER_SIZE, SEEK_END); + if (lseek(fd, (long) -TRAILER_SIZE, SEEK_END) == -1) + return BAD_BYTECODE; if (read(fd, (char *) trail, TRAILER_SIZE) < TRAILER_SIZE) return BAD_BYTECODE; fixup_endianness_trailer(&trail->num_sections); |