From 4cd4a5afa141544aa05c23ead5b6f9e9ccc3ac60 Mon Sep 17 00:00:00 2001 From: megacz Date: Sun, 14 Jun 2009 20:36:53 +0000 Subject: [PATCH] remove waklog_cache file after creating it git-svn-id: https://modwaklog.svn.sourceforge.net/svnroot/modwaklog/trunk/modwaklog@70 0d961d1b-a432-0410-8fea-cc29f225fe07 --- mod_waklog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.20.1