write_common: Don't abort if btr_exec_up() failed.
[paraslash.git] / write_common.c
index 93562d0d25781cf157d0c38ce5377bd8d99f2c2a..7131a94042dae3b989a73ee5a1b8cd4c84bf2b02 100644 (file)
@@ -153,7 +153,15 @@ static void get_btr_value(struct btr_node *btrn, const char *cmd,
        char *buf = NULL;
        int ret = btr_exec_up(btrn, cmd, &buf);
 
-       assert(ret >= 0);
+       if (ret < 0) {
+               /*
+                * This really should not happen. It means one of our parent
+                * nodes died unexpectedly. Proceed with fingers crossed.
+                */
+               PARA_CRIT_LOG("cmd %s: %s\n", cmd, para_strerror(-ret));
+               *result = 0;
+               return;
+       }
        ret = para_atoi32(buf, result);
        assert(ret >= 0);
        free(buf);