summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2008-12-17 17:22:22 +0000
committerNathan Kinder <nkinder@redhat.com>2008-12-17 17:22:22 +0000
commite6a8fd3f45a96fbb7da3e472c36382d59fadad4e (patch)
tree0d94d589b1e01dbd8e1a85b4ae533c7a640e7de4 /ldap/servers/slapd
parent9d681c65647ad8d895ae3a3f818eb7ca006b241e (diff)
downloadds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.tar.gz
ds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.tar.xz
ds-e6a8fd3f45a96fbb7da3e472c36382d59fadad4e.zip
Resolves: 445305
Summary: Ensure directories created by installer get the requested mode applied.
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r--ldap/servers/slapd/snmp_collator.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
index 9aefadce..9fb629d2 100644
--- a/ldap/servers/slapd/snmp_collator.c
+++ b/ldap/servers/slapd/snmp_collator.c
@@ -528,17 +528,22 @@ snmp_collator_create_semaphore()
if (errno == EEXIST) {
/* It appears that we didn't exit cleanly last time and left the semaphore
* around. Recreate it since we don't know what state it is in. */
- sem_unlink(stats_sem_name);
+ if (sem_unlink(stats_sem_name) != 0) {
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to delete old semaphore for stats file (%s). "
+ "Error %d (%s).\n", szStatsFile, errno, slapd_system_strerror(errno) );
+ exit(1);
+ }
+
if ((stats_sem = sem_open(stats_sem_name, O_CREAT | O_EXCL, SLAPD_DEFAULT_FILE_MODE, 1)) == SEM_FAILED) {
/* No dice */
- LDAPDebug( LDAP_DEBUG_ANY, "Failed to create semaphore for stats file (%s). Error %d.\n",
- szStatsFile, errno, 0 );
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to create semaphore for stats file (%s). Error %d (%s).\n",
+ szStatsFile, errno, slapd_system_strerror(errno) );
exit(1);
}
} else {
/* Some other problem occurred creating the semaphore. */
- LDAPDebug( LDAP_DEBUG_ANY, "Failed to create semaphore for stats file (%s). Error %d.\n",
- szStatsFile, errno, 0 );
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to create semaphore for stats file (%s). Error %d.(%s)\n",
+ szStatsFile, errno, slapd_system_strerror(errno) );
exit(1);
}
}