From 8abdc2eb40c03b97153f2a01bdb53927f3a336c1 Mon Sep 17 00:00:00 2001 From: Alexander Langer Date: Thu, 16 Jan 1997 21:58:40 +0000 Subject: 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 --- libexec/ftpd/ftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libexec/ftpd') diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index ebe7dd38b5ec..71565cf1c4d3 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1189,7 +1189,7 @@ send_data(instr, outstr, blksize, filesize, isreg) if (isreg && filesize < (off_t)16 * 1024 * 1024) { buf = mmap(0, filesize, PROT_READ, MAP_SHARED, filefd, (off_t)0); - if (!buf) { + if (buf == MAP_FAILED) { syslog(LOG_WARNING, "mmap(%lu): %m", (unsigned long)filesize); goto oldway; -- cgit v1.3