X-Git-Url: https://git.hcoop.net/hcoop/zz_old/modwaklog.git/blobdiff_plain/4480093f34ebfb288ab7d5672107ab4c4ab65834..4cd4a5afa141544aa05c23ead5b6f9e9ccc3ac60:/mod_waklog.c diff --git a/mod_waklog.c b/mod_waklog.c index bcacc55..9806460 100644 --- a/mod_waklog.c +++ b/mod_waklog.c @@ -1327,8 +1327,14 @@ waklog_init_handler (apr_pool_t * p, apr_pool_t * plog, /* mmap the region */ if ( ( sharedspace = (struct sharedspace_s *) mmap ( NULL, sizeof(struct sharedspace_s), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0 ) ) != MAP_FAILED ) { + int err = 0; log_error( APLOG_MARK, APLOG_DEBUG, 0, s, "mod_waklog: shared mmap region ok %d", sharedspace ); - close(fd); + err = unlink(cache_file); + if (err) { + log_error( APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: unable to delete %s due to %d", cache_file, errno); + } else { + log_error( APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: shared cache deleted"); + } } else { log_error( APLOG_MARK, APLOG_DEBUG, 0, s, "mod_waklog: mmap failed %d", errno ); exit(errno);