]> granicus.if.org Git - apache/commitdiff
Although this patch is technically correct, I'm not happy with
authorAaron Bannert <aaron@apache.org>
Wed, 23 Jan 2002 06:51:18 +0000 (06:51 +0000)
committerAaron Bannert <aaron@apache.org>
Wed, 23 Jan 2002 06:51:18 +0000 (06:51 +0000)
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

server/scoreboard.c

index 1365dfccce081b5db1dd3b83536cd9699715023b..ddc526f95ee07ac6c36f95f5cee798b5036c91c5 100644 (file)
@@ -164,15 +164,24 @@ static apr_status_t open_scoreboard(apr_pool_t *p)
     apr_status_t rv;
     char *fname = NULL;
 
-    if (ap_scoreboard_fname) {
-        fname = ap_server_root_relative(p, ap_scoreboard_fname);
-    }
     rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
-    if (rv != APR_SUCCESS) {
+    if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
-                     "Fatal error: could not open(create) scoreboard");
+                     "Fatal error: could not create scoreboard "
+                     "(using anonymous shared memory)");
         return rv;
     }
+    if (rv == APR_ENOTIMPL) {
+        if (ap_scoreboard_fname) {
+            fname = ap_server_root_relative(p, ap_scoreboard_fname);
+        }
+        rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
+        if (rv != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+                         "Fatal error: could not open(create) scoreboard");
+            return rv;
+        }
+    }
     /* everything will be cleared shortly */
 #endif
     return APR_SUCCESS;