From 44f0c449ba719ac7fa9aef7f8ed5635a3e7fa110 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 11 Sep 1999 15:58:37 +0000 Subject: [PATCH] This change should allow Apache to build on all platforms with the popenf changes. I have not been able to test this, but it should be evident what I am doing if it doesn't work. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83891 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/mpmt_pthread/scoreboard.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/mpm/mpmt_pthread/scoreboard.c b/server/mpm/mpmt_pthread/scoreboard.c index 34f0f8fba2..3992439f48 100644 --- a/server/mpm/mpmt_pthread/scoreboard.c +++ b/server/mpm/mpmt_pthread/scoreboard.c @@ -405,6 +405,8 @@ API_EXPORT(void) reopen_scoreboard(ap_context_t *p) #define SCOREBOARD_FILE static scoreboard _scoreboard_image; static int scoreboard_fd = -1; +static ap_file_t *scoreboard_file = NULL; +static ap_file_t *scoreboard_file = NULL; /* XXX: things are seriously screwed if we ever have to do a partial * read or write ... we could get a corrupted scoreboard @@ -447,9 +449,12 @@ static void cleanup_scoreboard_file(void *foo) API_EXPORT(void) reopen_scoreboard(ap_context_t *p) { if (scoreboard_fd != -1) - ap_pclosef(p, scoreboard_fd); + ap_close(scoreboard_fd); - scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0666); + ap_open(p, ap_scoreboard_fname, APR_CREATE | APR_BINARY | APR_READ | APR_WRITE, + APR_UREAD | APR_UWRITE | APR_GREAD | APR_GWRITE | APR_WREAD | APR_WWRITE, + &scoreboard_file); + ap_get_os_file(scoreboard_file, &scoreboard_fd); if (scoreboard_fd == -1) { perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); @@ -475,7 +480,9 @@ void reinit_scoreboard(ap_context_t *p) ap_scoreboard_image = &_scoreboard_image; ap_scoreboard_fname = ap_server_root_relative(p, ap_scoreboard_fname); - scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644); + ap_open(p, ap_scoreboard_fname, APR_CREATE | APR_BINARY | APR_READ | APR_WRITE, + APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, &scoreboard_file); + ap_get_os_file(scoreboard_file, &scoreboard_fd); if (scoreboard_fd == -1) { perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); -- 2.40.0