+ char **argvchild, **arg;
+ char *cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL);
+ GSList *scriptlist;
+ script_t *script;
+ char *cmdline;
+ int j=0;
+ int k;
+
+ aclose(app_err[0]);
+ dup2(app_err[1], 2);
+
+ k = application_property_argv_size(dle);
+ for (scriptlist = dle->scriptlist; scriptlist != NULL;
+ scriptlist = scriptlist->next) {
+ script = (script_t *)scriptlist->data;
+ if (script->result && script->result->proplist) {
+ k += property_argv_size(script->result->proplist);
+ }
+ }
+ argvchild = g_new0(char *, 18 + k);
+ argvchild[j++] = dle->program;
+ argvchild[j++] = "selfcheck";
+ if (bsu->message_line == 1) {
+ argvchild[j++] = "--message";
+ argvchild[j++] = "line";
+ }
+ if (g_options->config != NULL && bsu->config == 1) {
+ argvchild[j++] = "--config";
+ argvchild[j++] = g_options->config;
+ }
+ if (g_options->hostname != NULL && bsu->host == 1) {
+ argvchild[j++] = "--host";
+ argvchild[j++] = g_options->hostname;
+ }
+ if (dle->disk != NULL && bsu->disk == 1) {
+ argvchild[j++] = "--disk";
+ argvchild[j++] = dle->disk;
+ }
+ argvchild[j++] = "--device";
+ argvchild[j++] = dle->device;
+ if (dle->create_index && bsu->index_line == 1) {
+ argvchild[j++] = "--index";
+ argvchild[j++] = "line";
+ }
+ if (dle->record && bsu->record == 1) {
+ argvchild[j++] = "--record";
+ }
+ if (dle->calcsize && bsu->calcsize == 1) {
+ argvchild[j++] = "--calcsize";
+ }
+ j += application_property_add_to_argv(&argvchild[j], dle, bsu);
+
+ for (scriptlist = dle->scriptlist; scriptlist != NULL;
+ scriptlist = scriptlist->next) {
+ script = (script_t *)scriptlist->data;
+ if (script->result && script->result->proplist) {
+ j += property_add_to_argv(&argvchild[j],
+ script->result->proplist);
+ }
+ }
+
+ argvchild[j++] = NULL;
+
+ cmdline = stralloc(cmd);
+ for(arg = argvchild; *arg != NULL; arg++) {
+ char *quoted = quote_string(*arg);
+ cmdline = vstrextend(&cmdline, " ", quoted, NULL);
+ amfree(quoted);
+ }
+ dbprintf(_("Spawning \"%s\" in pipeline\n"), cmdline);
+ amfree(cmdline);
+
+ safe_fd(-1, 0);
+ execve(cmd, argvchild, safe_env());
+ g_printf(_("ERROR [Can't execute %s: %s]\n"), cmd, strerror(errno));