+ } else {
+ dumpout = compout;
+ comppid = -1;
+ }
+
+ cur_dumptime = time(0);
+ bsu = backup_support_option(dle->program, g_options, dle->disk,
+ dle->device, &errarray);
+ if (!bsu) {
+ char *errmsg;
+ char *qerrmsg;
+ guint i;
+ for (i=0; i < errarray->len; i++) {
+ errmsg = g_ptr_array_index(errarray, i);
+ qerrmsg = quote_string(errmsg);
+ fdprintf(mesgfd,
+ _("sendbackup: error [Application '%s': %s]\n"),
+ dle->program, errmsg);
+ dbprintf("aa: %s\n",qerrmsg);
+ amfree(qerrmsg);
+ }
+ if (i == 0) { /* no errarray */
+ errmsg = vstrallocf(_("Can't execute application '%s'"),
+ dle->program);
+ qerrmsg = quote_string(errmsg);
+ fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg);
+ dbprintf(_("ERROR %s\n"), qerrmsg);
+ amfree(qerrmsg);
+ amfree(errmsg);
+ }
+ return 0;
+ }
+
+ if (pipe(errfd) < 0) {
+ char *errmsg;
+ char *qerrmsg;
+ errmsg = vstrallocf(_("Application '%s': can't create pipe"),
+ dle->program);
+ qerrmsg = quote_string(errmsg);
+ fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg);
+ dbprintf(_("ERROR %s\n"), qerrmsg);
+ amfree(qerrmsg);
+ amfree(errmsg);
+ return 0;
+ }
+
+ switch(application_api_pid=fork()) {
+ case 0:
+ application_api_info_tapeheader(mesgfd, dle->program, dle);
+
+ /* find directt-tcp address from indirect direct-tcp */
+ if (dle->data_path == DATA_PATH_DIRECTTCP &&
+ bsu->data_path_set & DATA_PATH_DIRECTTCP &&
+ strncmp(dle->directtcp_list->data, "255.255.255.255:", 16) == 0) {
+ char *indirect_tcp;
+ char *str_port;
+ in_port_t port;
+ int fd;
+ char buffer[32770];
+ int size;
+ char *s, *s1;
+
+ indirect_tcp = g_strdup(dle->directtcp_list->data);
+ g_slist_free(dle->directtcp_list);
+ dle->directtcp_list = NULL;
+ str_port = strchr(indirect_tcp, ':');
+ str_port++;
+ port = atoi(str_port);
+ fd = stream_client("localhost", port, 32768, 32768, NULL, 0);
+ if (fd <= 0) {
+ g_debug("Failed to connect to indirect-direct-tcp port: %s",
+ strerror(errno));
+ exit(1);