+ if (ret == 0)
+ DSS_DEBUG_LOG("next snapshot due in %lu seconds\n",
+ tv2ms(&diff) / 1000);
+ else
+ DSS_DEBUG_LOG("next snapshot: now\n");
+ return ret;
+}
+
+static int pre_create_hook(void)
+{
+ int ret, fds[3] = {0, 0, 0};
+
+ assert(snapshot_creation_status == HS_READY);
+ if (!conf.pre_create_hook_given) {
+ snapshot_creation_status = HS_PRE_SUCCESS;
+ return 0;
+ }
+ DSS_DEBUG_LOG("executing %s\n", conf.pre_create_hook_arg);
+ ret = dss_exec_cmdline_pid(&create_pid,
+ conf.pre_create_hook_arg, fds);
+ if (ret < 0)
+ return ret;
+ snapshot_creation_status = HS_PRE_RUNNING;
+ return ret;