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

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