summaryrefslogtreecommitdiffstats
path: root/usr.bin/strip
diff options
context:
space:
mode:
authoralex <alex@FreeBSD.org>1997-01-16 21:58:40 +0000
committeralex <alex@FreeBSD.org>1997-01-16 21:58:40 +0000
commita3118e8c6826349b3fc54da3850d6dea994a3a35 (patch)
treed61898dd79824c10ca33127214d8569c804559c2 /usr.bin/strip
parent752ba4d26f2e94cc31940f50407a6b18b86ee0e8 (diff)
downloadFreeBSD-src-a3118e8c6826349b3fc54da3850d6dea994a3a35.zip
FreeBSD-src-a3118e8c6826349b3fc54da3850d6dea994a3a35.tar.gz
Sweep through the tree fixing mmap() usage:
- Use MAP_FAILED instead of the constant -1 to indicate failure (required by POSIX). - Removed flag arguments of '0' (required by POSIX). - Fixed code which expected an error return of 0. - Fixed code which thought any address with the high bit set was an error. - Check for failure where no checks were present. Discussed with: bde
Diffstat (limited to 'usr.bin/strip')
-rw-r--r--usr.bin/strip/strip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c
index 8fe4c49..36f14c2 100644
--- a/usr.bin/strip/strip.c
+++ b/usr.bin/strip/strip.c
@@ -173,7 +173,7 @@ s_stab(fn, fd, ep)
/* Map the file. */
if ((ep = (EXEC *)mmap(NULL, (size_t)sb.st_size,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)0)) == (EXEC *)-1) {
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)0)) == (EXEC *)MAP_FAILED) {
err(0, "%s: %s", fn, strerror(errno));
return;
}
OpenPOWER on IntegriCloud