Skip to content

Commit 03a53a8

Browse files
committed
Although this patch is technically correct, I'm not happy with
the way it gets things done. OTOH, it is a simple enough change to get things working correctly for now. I will come up with the right way to do this in the next couple days. This patch re-enables the use of anonymous shared memory in the scoreboard on platforms that have it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92978 13f79535-47bb-0310-9956-ffa450edef68
1 parent 93fc942 commit 03a53a8

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

server/scoreboard.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,24 @@ static apr_status_t open_scoreboard(apr_pool_t *p)
164164
apr_status_t rv;
165165
char *fname = NULL;
166166

167-
if (ap_scoreboard_fname) {
168-
fname = ap_server_root_relative(p, ap_scoreboard_fname);
169-
}
170167
rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
171-
if (rv != APR_SUCCESS) {
168+
if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) {
172169
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
173-
"Fatal error: could not open(create) scoreboard");
170+
"Fatal error: could not create scoreboard "
171+
"(using anonymous shared memory)");
174172
return rv;
175173
}
174+
if (rv == APR_ENOTIMPL) {
175+
if (ap_scoreboard_fname) {
176+
fname = ap_server_root_relative(p, ap_scoreboard_fname);
177+
}
178+
rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
179+
if (rv != APR_SUCCESS) {
180+
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
181+
"Fatal error: could not open(create) scoreboard");
182+
return rv;
183+
}
184+
}
176185
/* everything will be cleared shortly */
177186
#endif
178187
return APR_SUCCESS;

0 commit comments

Comments
 (0)