X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexelfsgi.c;h=95844f3cfa684a0aaa1ebad4869cefb634b14efe;hb=f94fbd3020e40c3685853c905014f2ae310b02c7;hp=ee9316739314fc2b205526a48d105f60ddd162dc;hpb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;p=chise%2Fxemacs-chise.git.1 diff --git a/src/unexelfsgi.c b/src/unexelfsgi.c index ee93167..95844f3 100644 --- a/src/unexelfsgi.c +++ b/src/unexelfsgi.c @@ -226,9 +226,10 @@ unexec (char *new_name, fatal ("Can't fstat (%s): errno %d\n", old_name, errno); /* map old file into the address space. */ - if ( (old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, - PROT_READ, MAP_SHARED, old_file, 0)) < 0 ) - fatal ("Can't mmap (%s): errno %d\n", old_name, errno); + old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, + PROT_READ, MAP_SHARED, old_file, 0); + if (old_base == (caddr_t) MAP_FAILED) + fatal ("Can't mmap (%s): errno %d\n", old_name, errno); old_file_h = (ElfW(Ehdr) *) old_base; old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff);