diff options
Diffstat (limited to 'src/libopts/text_mmap.c')
-rw-r--r-- | src/libopts/text_mmap.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/libopts/text_mmap.c b/src/libopts/text_mmap.c index 4a7aa1a238..8b117c0599 100644 --- a/src/libopts/text_mmap.c +++ b/src/libopts/text_mmap.c @@ -3,11 +3,13 @@ * * Map a text file, ensuring the text always has an ending NUL byte. * - * Time-stamp: "2012-01-29 09:40:21 bkorb" - * + * @addtogroup autoopts + * @{ + */ +/* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -19,11 +21,11 @@ * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * - * These files have the following md5sums: + * These files have the following sha256 sums: * - * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 - * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 - * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd + * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3 + * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3 + * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd */ #if defined(HAVE_MMAP) # ifndef MAP_ANONYMOUS @@ -97,8 +99,7 @@ load_text_file(tmap_info_t * mapinfo, char const * pzFile) ssize_t rdct = read(mapinfo->txt_fd, pz, sz); if (rdct <= 0) { mapinfo->txt_errno = errno; - fprintf(stderr, zFSErrReadFile, - errno, strerror(errno), pzFile); + fserr_warn("libopts", "read", pzFile); free(mapinfo->txt_data); return; } @@ -113,7 +114,7 @@ load_text_file(tmap_info_t * mapinfo, char const * pzFile) mapinfo->txt_errno = 0; #else /* HAVE mmap */ - size_t const pgsz = GETPAGESIZE(); + size_t const pgsz = (size_t)GETPAGESIZE(); void * map_addr = NULL; (void)pzFile; @@ -189,7 +190,7 @@ validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo) return; } - mapinfo->txt_size = sb.st_size; + mapinfo->txt_size = (size_t)sb.st_size; } /* @@ -361,7 +362,8 @@ text_munmap(tmap_info_t * mi) return mi->txt_errno; } -/* +/** @} + * * Local Variables: * mode: C * c-file-style: "stroustrup" |