diff options
| author | Alexander Langer <alex@FreeBSD.org> | 1997-01-16 21:58:40 +0000 |
|---|---|---|
| committer | Alexander Langer <alex@FreeBSD.org> | 1997-01-16 21:58:40 +0000 |
| commit | 8abdc2eb40c03b97153f2a01bdb53927f3a336c1 (patch) | |
| tree | d61898dd79824c10ca33127214d8569c804559c2 /libexec | |
| parent | 839cc09e5384e6f8c0ebb9203052015b532cfce7 (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ftpd/ftpd.c | 2 | ||||
| -rw-r--r-- | libexec/lfs_cleanerd/library.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index ebe7dd38b5ece..71565cf1c4d3a 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; diff --git a/libexec/lfs_cleanerd/library.c b/libexec/lfs_cleanerd/library.c index 9397f6245206f..93951c6aad1f8 100644 --- a/libexec/lfs_cleanerd/library.c +++ b/libexec/lfs_cleanerd/library.c @@ -204,8 +204,8 @@ get_ifile (fsp, use_mmap) if (fsp->fi_cip) munmap((caddr_t)fsp->fi_cip, fsp->fi_ifile_length); ifp = mmap ((caddr_t)0, file_stat.st_size, - PROT_READ|PROT_WRITE, 0, fid, (off_t)0); - if (ifp == (caddr_t)(-1)) + PROT_READ|PROT_WRITE, MAP_SHARED, fid, (off_t)0); + if (ifp == MAP_FAILED) err(1, "get_ifile: mmap failed"); } else { if (fsp->fi_cip) @@ -541,8 +541,8 @@ mmap_segment (fsp, segment, segbuf, use_mmap) if (use_mmap) { *segbuf = mmap ((caddr_t)0, seg_size(lfsp), PROT_READ, - 0, fid, seg_byte); - if (*(long *)segbuf < 0) { + MAP_SHARED, fid, seg_byte); + if (*segbuf == MAP_FAILED) { err(0, "mmap_segment: mmap failed"); return (NULL); } |
