diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2009-07-20 15:40:10 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2009-07-20 15:40:10 -0700 |
commit | 8da07138e5011bf7f4fab53fe47152bc12b8239b (patch) | |
tree | d764a2b976f64f42c7491ccddff84213f7cbbce5 /ldap | |
parent | 654c62253e13df368be9a2e1b89e03771e363041 (diff) | |
download | ds-8da07138e5011bf7f4fab53fe47152bc12b8239b.tar.gz ds-8da07138e5011bf7f4fab53fe47152bc12b8239b.tar.xz ds-8da07138e5011bf7f4fab53fe47152bc12b8239b.zip |
510147 clean up the replication log msg
_cl5DBOpen removes a changelog db if there is no matching replica for the file.
The manner to remove the changelog db file was not good -- not using the API
that Berkeley DB provided, but removing it with NSPR delete function PR_Delete.
This fix replaces PR_Delete with the Berkeley DB API dbremove.
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/servers/plugins/replication/cl5_api.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index dfc5765d..94b80fda 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -2514,14 +2514,15 @@ static int _cl5DBOpen () slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen: " "file %s has no matching replica; removing\n", entry->name); - PR_snprintf(fullpathname, MAXPATHLEN, "%s/%s", s_cl5Desc.dbDir, entry->name); - if (PR_Delete(fullpathname) != PR_SUCCESS) - { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBOpen: " - "failed to remove (%s) file; NSPR error - %d\n", - entry->name, PR_GetError ()); - - } + rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, + 0, fullpathname, 0, 0); + if (rc != 0) + { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, + "_cl5DBOpen: failed to remove (%s) file; " + "libdb error - %d (%s)\n", + fullpathname, rc, db_strerror(rc)); + } } } } |