diff options
Diffstat (limited to 'src/lib/kdb/kdb_log.c')
-rw-r--r-- | src/lib/kdb/kdb_log.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/kdb/kdb_log.c b/src/lib/kdb/kdb_log.c index 0842439a3..c254ab27d 100644 --- a/src/lib/kdb/kdb_log.c +++ b/src/lib/kdb/kdb_log.c @@ -19,6 +19,10 @@ #include "kdb_log.h" #include "kdb5int.h" +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + /* * This modules includes all the necessary functions that create and * modify the Kerberos principal update and header logs. @@ -602,7 +606,7 @@ ulog_map(krb5_context context, const char *logname, uint32_t ulogentries, PROT_READ+PROT_WRITE, MAP_SHARED, ulogfd, 0); } - if ((int)(ulog) == -1) { + if (ulog == MAP_FAILED) { /* * Can't map update log file to memory */ @@ -901,7 +905,7 @@ ulog_set_role(krb5_context ctx, iprop_role role) */ static int extend_file_to(int fd, uint_t new_size) { - int current_offset; + off_t current_offset; static const char zero[512] = { 0, }; current_offset = lseek(fd, 0, SEEK_END); @@ -911,7 +915,7 @@ static int extend_file_to(int fd, uint_t new_size) errno = EINVAL; return -1; } - while (current_offset < new_size) { + while (current_offset < (off_t)new_size) { int write_size, wrote_size; write_size = new_size - current_offset; if (write_size > 512) |