Blame SOURCES/0051-Ticket-48538-Failed-to-delete-old-semaphore.patch

b69e47
From bbc63ef4dab6c275b1d8b8fe6439483309781401 Mon Sep 17 00:00:00 2001
b69e47
From: William Brown <firstyear@redhat.com>
b69e47
Date: Fri, 12 May 2017 10:09:32 +1000
b69e47
Subject: [PATCH] Ticket 48538 - Failed to delete old semaphore
b69e47
b69e47
Bug Description:  I misunderstood the sem_unlink call, and logged
b69e47
the wrong filepath.
b69e47
b69e47
Fix Description:  Fix the file path of the semaphore.
b69e47
b69e47
https://pagure.io/389-ds-base/issue/48538
b69e47
b69e47
Author: wibrown
b69e47
b69e47
Review by: mreynolds (Thanks!)
b69e47
b69e47
(cherry picked from commit b81c8ba38c29e15e13b0dd0bf6f5d3c773d31b20)
b69e47
---
b69e47
 ldap/servers/slapd/snmp_collator.c | 12 ++++++------
b69e47
 1 file changed, 6 insertions(+), 6 deletions(-)
b69e47
b69e47
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
b69e47
index 21043d9..2deab91 100644
b69e47
--- a/ldap/servers/slapd/snmp_collator.c
b69e47
+++ b/ldap/servers/slapd/snmp_collator.c
b69e47
@@ -458,23 +458,23 @@ snmp_collator_create_semaphore(void)
b69e47
              * around.  Recreate it since we don't know what state it is in. */
b69e47
             if (sem_unlink(stats_sem_name) != 0) {
b69e47
                 slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore",
b69e47
-                        "Failed to delete old semaphore for stats file (%s). "
b69e47
-                        "Error %d (%s).\n", stats_sem_name, errno, slapd_system_strerror(errno) );
b69e47
+                        "Failed to delete old semaphore for stats file (/dev/shm/sem.%s). "
b69e47
+                        "Error %d (%s).\n", stats_sem_name + 1, errno, slapd_system_strerror(errno) );
b69e47
                 exit(1);
b69e47
             }
b69e47
 
b69e47
             if ((stats_sem = sem_open(stats_sem_name, O_CREAT | O_EXCL, SLAPD_DEFAULT_FILE_MODE, 1)) == SEM_FAILED) {
b69e47
                 /* No dice */
b69e47
                 slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore",
b69e47
-                        "Failed to create semaphore for stats file (%s). Error %d (%s).\n",
b69e47
-                        stats_sem_name, errno, slapd_system_strerror(errno) );
b69e47
+                        "Failed to create semaphore for stats file (/dev/shm/sem.%s). Error %d (%s).\n",
b69e47
+                        stats_sem_name + 1, errno, slapd_system_strerror(errno) );
b69e47
                 exit(1);
b69e47
             }
b69e47
         } else {
b69e47
             /* Some other problem occurred creating the semaphore. */
b69e47
             slapi_log_err(SLAPI_LOG_EMERG, "snmp_collator_create_semaphore",
b69e47
-                    "Failed to create semaphore for stats file (%s). Error %d.(%s)\n",
b69e47
-                    stats_sem_name, errno, slapd_system_strerror(errno) );
b69e47
+                    "Failed to create semaphore for stats file (/dev/shm/sem.%s). Error %d.(%s)\n",
b69e47
+                    stats_sem_name + 1, errno, slapd_system_strerror(errno) );
b69e47
             exit(1);
b69e47
         }
b69e47
     }
b69e47
-- 
b69e47
2.9.4
b69e47