s3: VFS: default: Remove fallback if we don't have HAVE_PWRITE set. Samba doesn't...
[samba.git] / ctdb / server / ctdb_update_record.c
index 1ecb089940ed9cb926b3af02177fd3b3e4af8090..04b6901ce55eb51d4b41c98c79192df105fe0cb2 100644 (file)
 #include "lib/tdb_wrap/tdb_wrap.h"
 #include "lib/util/debug.h"
 #include "lib/util/samba_util.h"
+#include "lib/util/sys_rw.h"
+#include "lib/util/util_process.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
-#include "ctdb_logging.h"
 
 #include "common/system.h"
 #include "common/common.h"
+#include "common/logging.h"
 
 struct ctdb_persistent_write_state {
        struct ctdb_db_context *ctdb_db;
@@ -265,8 +267,7 @@ static struct childwrite_handle *ctdb_childwrite(
                char c = 0;
 
                close(result->fd[0]);
-               ctdb_set_process_name("ctdb_write_persistent");
-               debug_extra = talloc_asprintf(NULL, "childwrite-%s:", ctdb_db->db_name);
+               prctl_set_comment("ctdb_write_persistent");
                ret = ctdb_persistent_store(state);
                if (ret != 0) {
                        DEBUG(DEBUG_ERR, (__location__ " Failed to write persistent data\n"));
@@ -275,10 +276,7 @@ static struct childwrite_handle *ctdb_childwrite(
 
                sys_write(result->fd[1], &c, 1);
 
-               /* make sure we die when our parent dies */
-               while (ctdb_kill(ctdb_db->ctdb, parent, 0) == 0 || errno != ESRCH) {
-                       sleep(5);
-               }
+               ctdb_wait_for_process_to_exit(parent);
                _exit(0);
        }
 
@@ -341,7 +339,7 @@ int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
        state->c       = c;
        state->m       = m;
        state->flags   = 0;
-       if (!ctdb_db->persistent) {
+       if (ctdb_db_volatile(ctdb_db)) {
                state->flags   = UPDATE_FLAGS_REPLACE_ONLY;
        }