summaryrefslogtreecommitdiff
path: root/src/unexhp9k800.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unexhp9k800.c')
-rw-r--r--src/unexhp9k800.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c
index 259b9318514..8d34a3a3d7a 100644
--- a/src/unexhp9k800.c
+++ b/src/unexhp9k800.c
@@ -60,6 +60,7 @@ unexec(new_name, old_name, new_end_of_text, dummy1, dummy2)
int old_size, new_size;
struct header hdr;
struct som_exec_auxhdr auxhdr;
+ long i;
/* For the greatest flexibility, should create a temporary file in
the same directory as the new file. When everything is complete,
@@ -81,7 +82,10 @@ unexec(new_name, old_name, new_end_of_text, dummy1, dummy2)
/* Decide how large the new and old data areas are */
old_size = auxhdr.exec_dsize;
- new_size = sbrk(0) - auxhdr.exec_dmem;
+ /* I suspect these two statements are separate
+ to avoid a compiler bug in hpux version 8. */
+ i = sbrk (0);
+ new_size = i - auxhdr.exec_dmem;
/* Copy the old file to the new, up to the data space */
lseek(old, 0, 0);