source: MondoRescue/trunk/mondo/mondo/src/libmondo-fork.c@ 795

Last change on this file since 795 was 783, checked in by Bruno Cornec, 18 years ago
  • Massive rewrite continues for memory management.
  • main structure should now have all parameters allocated dynamically
  • new lib libmr.a + dir + build process reviewed to support it.
  • new include subdir to host external definitions of the new lib
  • code now compiles. Still one remaining link issues for mondorestore. This should allow for some tests soon.

(goal is to separate completely reviewed code and functions and provide clean interfaces)

  • Property svn:keywords set to Id
File size: 18.5 KB
Line 
1/* libmondo-fork.c - subroutines for handling forking/pthreads/etc.
2 * $Id: libmondo-fork.c 783 2006-08-31 15:09:20Z bruno $
3 */
4
5#include "my-stuff.h"
6#include "mondostructures.h"
7#include "libmondo-fork.h"
8#include "libmondo-string-EXT.h"
9#include "newt-specific-EXT.h"
10#include "libmondo-files-EXT.h"
11#include "libmondo-tools-EXT.h"
12
13extern bool g_text_mode;
14pid_t g_buffer_pid = 0;
15
16
17/**
18 * Call a program and retrieve its last line of output.
19 * @param call The program to run.
20 * @return The last line of its output.
21 * @note The returned value should be freed by caller
22 */
23char *call_program_and_get_last_line_of_output(char *call)
24{
25 char *result = NULL;
26 FILE *fin = NULL;
27 size_t n = 0;
28
29 assert_string_is_neither_NULL_nor_zerolength(call);
30
31 if ((fin = popen(call, "r"))) {
32 for (getline(&result, &n, fin); !feof(fin); getline(&result, &n, fin));
33 paranoid_pclose(fin);
34 } else {
35 log_OS_error("Unable to popen call");
36 }
37 return(result);
38}
39
40#define MONDO_POPMSG _("Your PC will not retract the CD tray automatically. Please call mondoarchive with the -m (manual CD tray) flag.")
41
42/**
43 * Call mkisofs to create an ISO image.
44 * @param bkpinfo The backup information structure. Fields used:
45 * - @c bkpinfo->manual_cd_tray
46 * - @c bkpinfo->backup_media_type
47 * - @c bkpinfo->please_dont_eject_when_restoring
48 * @param basic_call The call to mkisofs. May contain tokens that will be resolved to actual data. The tokens are:
49 * - @c _ISO_ will become the ISO file (@p isofile)
50 * - @c _CD#_ becomes the CD number (@p cd_no)
51 * - @c _ERR_ becomes the logfile (@p g_logfile)
52 * @param isofile Replaces @c _ISO_ in @p basic_call. Should probably be the ISO image to create (-o parameter to mkisofs).
53 * @param cd_no Replaces @c _CD#_ in @p basic_call. Should probably be the CD number.
54 * @param logstub Unused.
55 * @param what_i_am_doing The action taking place (e.g. "Making ISO #1"). Used as the title of the progress dialog.
56 * @return Exit code of @c mkisofs (0 is success, anything else indicates failure).
57 * @bug @p logstub is unused.
58 */
59int
60eval_call_to_make_ISO(struct s_bkpinfo *bkpinfo,
61 char *basic_call, char *isofile,
62 int cd_no, char *logstub, char *what_i_am_doing)
63{
64
65 /*@ int's *** */
66 int retval = 0;
67
68
69 /*@ buffers *** */
70 char *midway_call, *ultimate_call, *tmp, *command,
71 *cd_number_str;
72 char *p;
73
74/*@*********** End Variables ***************************************/
75
76 log_msg(3, "Starting");
77 assert(bkpinfo != NULL);
78 assert_string_is_neither_NULL_nor_zerolength(basic_call);
79 assert_string_is_neither_NULL_nor_zerolength(isofile);
80 assert_string_is_neither_NULL_nor_zerolength(logstub);
81 if (!(midway_call = malloc(1200))) {
82 fatal_error("Cannot malloc midway_call");
83 }
84 if (!(ultimate_call = malloc(1200))) {
85 fatal_error("Cannot malloc ultimate_call");
86 }
87 if (!(tmp = malloc(1200))) {
88 fatal_error("Cannot malloc tmp");
89 }
90
91 asprintf(&cd_number_str, "%d", cd_no);
92 resolve_naff_tokens(midway_call, basic_call, isofile, "_ISO_");
93 resolve_naff_tokens(tmp, midway_call, cd_number_str, "_CD#_");
94 paranoid_free(cd_number_str);
95
96 resolve_naff_tokens(ultimate_call, tmp, MONDO_LOGFILE, "_ERR_");
97 log_msg(4, "basic call = '%s'", basic_call);
98 log_msg(4, "midway_call = '%s'", midway_call);
99 log_msg(4, "tmp = '%s'", tmp);
100 log_msg(4, "ultimate call = '%s'", ultimate_call);
101 asprintf(&command, "%s >> %s", ultimate_call, MONDO_LOGFILE);
102
103 log_to_screen
104 (_("Please be patient. Do not be alarmed by on-screen inactivity."));
105 log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'",
106 what_i_am_doing);
107 if (bkpinfo->manual_cd_tray) {
108 /* Find everything after a 2>> and remove it */
109 p = strstr(command, "2>>");
110 if (p) {
111 for (; *p != ' ' && *p != '\0'; p++) {
112 *p = ' ';
113 }
114 }
115#ifndef _XWIN
116 if (!g_text_mode) {
117 newtSuspend();
118 }
119#endif
120 log_msg(1, "command = '%s'", command);
121 retval += system(command);
122 if (!g_text_mode) {
123 newtResume();
124 }
125 if (retval) {
126 log_msg(2, "Basic call '%s' returned an error.", basic_call);
127 popup_and_OK(_("Press ENTER to continue."));
128 popup_and_OK
129 (_("mkisofs and/or cdrecord returned an error. CD was not created"));
130 }
131 }
132 /* if text mode then do the above & RETURN; if not text mode, do this... */
133 else {
134 log_msg(3, "command = '%s'", command);
135// yes_this_is_a_goto:
136 retval =
137 run_external_binary_with_percentage_indicator_NEW
138 (what_i_am_doing, command);
139 }
140 paranoid_free(command);
141
142 paranoid_free(midway_call);
143 paranoid_free(ultimate_call);
144 paranoid_free(tmp);
145 return (retval);
146}
147
148
149/**
150 * Run a program and log its output (stdout and stderr) to the logfile.
151 * @param program The program to run. Passed to the shell, so you can use pipes etc.
152 * @param debug_level If @p g_loglevel is higher than this, do not log the output.
153 * @return The exit code of @p program (depends on the command, but 0 almost always indicates success).
154 */
155int run_program_and_log_output(char *program, int debug_level)
156{
157 /*@ buffer ****************************************************** */
158 char *callstr = NULL;
159 char *incoming = NULL;
160
161 /*@ int ********************************************************* */
162 int res = 0;
163 size_t n = 0;
164 bool log_if_failure = FALSE;
165 bool log_if_success = FALSE;
166
167 /*@ pointers *************************************************** */
168 FILE *fin;
169 char *p;
170
171 /*@ end vars *************************************************** */
172
173 assert(program != NULL);
174 if (!program[0]) {
175 log_msg(2, "Warning - asked to run zerolength program");
176 return (1);
177 }
178
179 if (debug_level <= g_loglevel) {
180 log_if_success = TRUE;
181 log_if_failure = TRUE;
182 }
183 asprintf(&callstr,
184 "%s > /tmp/mondo-run-prog-thing.tmp 2> /tmp/mondo-run-prog-thing.err",
185 program);
186 while ((p = strchr(callstr, '\r'))) {
187 *p = ' ';
188 }
189 while ((p = strchr(callstr, '\n'))) {
190 *p = ' ';
191 } /* single '=' is intentional */
192
193
194 res = system(callstr);
195 if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) {
196 log_msg(0, "running: %s", callstr);
197 log_msg(0,
198 "--------------------------------start of output-----------------------------");
199 }
200 paranoid_free(callstr);
201
202 if (log_if_failure
203 &&
204 system
205 ("cat /tmp/mondo-run-prog-thing.err >> /tmp/mondo-run-prog-thing.tmp 2> /dev/null"))
206 {
207 log_OS_error("Command failed");
208 }
209 unlink("/tmp/mondo-run-prog-thing.err");
210 fin = fopen("/tmp/mondo-run-prog-thing.tmp", "r");
211 if (fin) {
212 for (getline(&incoming, &n, fin); !feof(fin);
213 getline(&incoming, &n, fin)) {
214 /* patch by Heiko Schlittermann */
215 p = incoming;
216 while (p && *p) {
217 if ((p = strchr(p, '%'))) {
218 memmove(p, p + 1, strlen(p) + 1);
219 p += 2;
220 }
221 }
222 /* end of patch */
223 strip_spaces(incoming);
224 if ((res == 0 && log_if_success)
225 || (res != 0 && log_if_failure)) {
226 log_msg(0, incoming);
227 }
228 }
229 paranoid_free(incoming);
230 paranoid_fclose(fin);
231 }
232 unlink("/tmp/mondo-run-prog-thing.tmp");
233 if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) {
234 log_msg(0,
235 "--------------------------------end of output------------------------------");
236 if (res) {
237 log_msg(0, "...ran with res=%d", res);
238 } else {
239 log_msg(0, "...ran just fine. :-)");
240 }
241 }
242// else
243// { log_msg (0, "-------------------------------ran w/ res=%d------------------------------", res); }
244 return (res);
245}
246
247
248/**
249 * Run a program and log its output to the screen.
250 * @param basic_call The program to run.
251 * @param what_i_am_doing The title of the evalcall form.
252 * @return The return value of the command (varies, but 0 almost always means success).
253 * @see run_program_and_log_output
254 * @see log_to_screen
255 */
256int run_program_and_log_to_screen(char *basic_call, char *what_i_am_doing)
257{
258 /*@ int ******************************************************** */
259 int retval = 0;
260 int res = 0;
261 int i;
262
263 /*@ pointers **************************************************** */
264 FILE *fin;
265
266 /*@ buffers **************************************************** */
267 char *tmp;
268 char *command;
269 char *lockfile;
270
271 /*@ end vars *************************************************** */
272
273 assert_string_is_neither_NULL_nor_zerolength(basic_call);
274
275 asprintf(&lockfile, "/tmp/mojo-jojo.blah.XXXXXX");
276 mkstemp(lockfile);
277 asprintf(&command,
278 "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res",
279 lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile);
280 open_evalcall_form(what_i_am_doing);
281 asprintf(&tmp, "Executing %s", basic_call);
282 log_msg(2, tmp);
283 paranoid_free(tmp);
284
285 if (!(fin = popen(command, "r"))) {
286 log_OS_error("Unable to popen-in command");
287 asprintf(&tmp, _("Failed utterly to call '%s'"), command);
288 log_to_screen(tmp);
289 paranoid_free(tmp);
290 paranoid_free(lockfile);
291 paranoid_free(command);
292 return (1);
293 }
294 paranoid_free(command);
295
296 if (!does_file_exist(lockfile)) {
297 log_to_screen(_("Waiting for external binary to start"));
298 for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) {
299 log_msg(3, "Waiting for lockfile %s to exist", lockfile);
300 }
301 }
302 /* This works on Newt, and it gives quicker updates. */
303 for (; does_file_exist(lockfile); sleep(1)) {
304 log_file_end_to_screen(MONDO_LOGFILE, "");
305 update_evalcall_form(1);
306 }
307 /* Evaluate the status returned by pclose to get the exit code of the called program. */
308 errno = 0;
309 res = pclose(fin);
310 /* Log actual pclose errors. */
311 if (errno)
312 log_msg(5, "pclose err: %d", errno);
313 /* Check if we have a valid status. If we do, extract the called program's exit code. */
314 /* If we don't, highlight this fact by returning -1. */
315 if (WIFEXITED(res)) {
316 retval = WEXITSTATUS(res);
317 } else {
318 retval = -1;
319 }
320 close_evalcall_form();
321 unlink(lockfile);
322 paranoid_free(lockfile);
323
324 return (retval);
325}
326
327
328/**
329 * Apparently used. @bug This has a purpose, but what?
330 */
331#define PIMP_START_SZ "STARTSTARTSTART9ff3kff9a82gv34r7fghbkaBBC2T231hc81h42vws8"
332#define PIMP_END_SZ "ENDENDEND0xBBC10xBBC2T231hc81h42vws89ff3kff9a82gv34r7fghbka"
333
334
335
336
337int copy_from_src_to_dest(FILE * f_orig, FILE * f_archived, char direction)
338{
339// if dir=='w' then copy from orig to archived
340// if dir=='r' then copy from archived to orig
341 char *tmp = NULL;
342 char *buf = NULL;
343 long int bytes_to_be_read, bytes_read_in, bytes_written_out =
344 0, bufcap, subsliceno = 0;
345 int retval = 0;
346 FILE *fin = NULL;
347 FILE *fout = NULL;
348 FILE *ftmp = NULL;
349
350 log_msg(5, "Opening.");
351 bufcap = 256L * 1024L;
352 if (!(buf = malloc(bufcap))) {
353 fatal_error("Failed to malloc() buf");
354 }
355
356 if (direction == 'w') {
357 fin = f_orig;
358 fout = f_archived;
359 asprintf(&tmp, "%-64s", PIMP_START_SZ);
360 if (fwrite(tmp, 1, 64, fout) != 64) {
361 fatal_error("Can't write the introductory block");
362 }
363 paranoid_free(tmp);
364
365 while (1) {
366 bytes_to_be_read = bytes_read_in = fread(buf, 1, bufcap, fin);
367 if (bytes_read_in == 0) {
368 break;
369 }
370 asprintf(&tmp, "%-64ld", bytes_read_in);
371 if (fwrite(tmp, 1, 64, fout) != 64) {
372 fatal_error("Cannot write introductory block");
373 }
374 paranoid_free(tmp);
375
376 log_msg(7,
377 "subslice #%ld --- I have read %ld of %ld bytes in from f_orig",
378 subsliceno, bytes_read_in, bytes_to_be_read);
379 bytes_written_out += fwrite(buf, 1, bytes_read_in, fout);
380 asprintf(&tmp, "%-64ld", subsliceno);
381 if (fwrite(tmp, 1, 64, fout) != 64) {
382 fatal_error("Cannot write post-thingy block");
383 }
384 paranoid_free(tmp);
385
386 log_msg(7, "Subslice #%d written OK", subsliceno);
387 subsliceno++;
388 }
389 asprintf(&tmp, "%-64ld", 0L);
390 if (fwrite(tmp, 1, 64L, fout) != 64L) {
391 fatal_error("Cannot write final introductory block");
392 }
393 } else {
394 fin = f_archived;
395 fout = f_orig;
396 if (!(tmp = malloc(64L))) {
397 fatal_error("Failed to malloc() tmp");
398 }
399 if (fread(tmp, 1, 64L, fin) != 64L) {
400 fatal_error("Cannot read the introductory block");
401 }
402 log_msg(5, "tmp is %s", tmp);
403 if (!strstr(tmp, PIMP_START_SZ)) {
404 fatal_error("Can't find intro blk");
405 }
406 if (fread(tmp, 1, 64L, fin) != 64L) {
407 fatal_error("Cannot read introductory blk");
408 }
409 bytes_to_be_read = atol(tmp);
410 while (bytes_to_be_read > 0) {
411 log_msg(7, "subslice#%ld, bytes=%ld", subsliceno,
412 bytes_to_be_read);
413 bytes_read_in = fread(buf, 1, bytes_to_be_read, fin);
414 if (bytes_read_in != bytes_to_be_read) {
415 fatal_error
416 ("Danger, WIll Robinson. Failed to read whole subvol from archives.");
417 }
418 bytes_written_out += fwrite(buf, 1, bytes_read_in, fout);
419 if (fread(tmp, 1, 64L, fin) != 64L) {
420 fatal_error("Cannot read post-thingy block");
421 }
422 if (atol(tmp) != subsliceno) {
423 log_msg(1, "Wanted subslice %ld but got %ld ('%s')",
424 subsliceno, atol(tmp), tmp);
425 }
426 log_msg(7, "Subslice #%ld read OK", subsliceno);
427 subsliceno++;
428 if (fread(tmp, 1, 64L, fin) != 64L) {
429 fatal_error("Cannot read introductory block");
430 }
431 bytes_to_be_read = atol(tmp);
432 }
433 }
434
435// log_msg(4, "Written %ld of %ld bytes", bytes_written_out, bytes_read_in);
436
437 if (direction == 'w') {
438 paranoid_free(tmp);
439 asprintf(&tmp, "%-64s", PIMP_END_SZ);
440 if (fwrite(tmp, 1, 64L, fout) != 64L) {
441 fatal_error("Can't write the final block");
442 }
443 paranoid_free(tmp);
444 } else {
445 log_msg(1, "tmpA is %s", tmp);
446 if (!strstr(tmp, PIMP_END_SZ)) {
447 if (fread(tmp, 1, 64L, fin) != 64L) {
448 fatal_error("Can't read the final block");
449 }
450 log_msg(5, "tmpB is %s", tmp);
451 if (!strstr(tmp, PIMP_END_SZ)) {
452 ftmp = fopen("/tmp/out.leftover", "w");
453 bytes_read_in = fread(tmp, 1, 64L, fin);
454 log_msg(1, "bytes_read_in = %ld", bytes_read_in);
455// if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); }
456 fwrite(tmp, 1, bytes_read_in, ftmp);
457
458 paranoid_free(tmp);
459 if (!(tmp = malloc(512))) {
460 fatal_error("Failed to malloc() tmp");
461 }
462 /* BERLIOS : strange ???
463 s-printf(tmp, "I am here - %llu", ftello(fin));
464 log_msg(0, tmp);
465 */
466 fread(tmp, 1, 512, fin);
467 log_msg(0, "tmp = '%s'", tmp);
468 fwrite(tmp, 1, 512, ftmp);
469 fclose(ftmp);
470 fatal_error("Missing terminating block");
471 }
472 }
473 paranoid_free(tmp);
474 }
475
476 paranoid_free(buf);
477 log_msg(3, "Successfully copied %ld bytes", bytes_written_out);
478 return (retval);
479}
480
481/**
482 * Feed @p input_device through ntfsclone to @p output_fname.
483 * @param input_device The device to image.
484 * @param output_fname The file to write.
485 * @return 0 for success, nonzero for failure.
486 */
487int feed_into_ntfsprog(char *input_device, char *output_fname)
488{
489// BACKUP
490 int res = -1;
491 char *command = NULL;
492 char *tmp = NULL;
493
494 if (!does_file_exist(input_device)) {
495 fatal_error("input device does not exist");
496 }
497 tmp = find_home_of_exe("ntfsclone");
498 if (!tmp) {
499 fatal_error("ntfsclone not found");
500 }
501 paranoid_free(tmp);
502
503 asprintf(&command, "ntfsclone --force --save-image --overwrite %s %s", output_fname, input_device);
504 res = run_program_and_log_output(command, 5);
505 paranoid_free(command);
506
507 unlink(output_fname);
508 return (res);
509}
510
511
512int run_external_binary_with_percentage_indicator_OLD(char *tt, char *cmd)
513{
514
515 int res = 0;
516 int percentage = 0;
517 int maxpc = 0;
518 int pcno = 0;
519 int last_pcno = 0;
520
521 char *command = NULL;
522 char *tempfile = NULL;
523 FILE *pin = NULL;
524
525 assert_string_is_neither_NULL_nor_zerolength(cmd);
526
527 tempfile = call_program_and_get_last_line_of_output("mktemp -q /tmp/mondo.XXXXXXXX");
528 asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
529 tempfile);
530 log_msg(3, command);
531 open_evalcall_form(tt);
532
533 if (!(pin = popen(command, "r"))) {
534 log_OS_error("fmt err");
535 paranoid_free(command);
536 paranoid_free(tempfile);
537 return (1);
538 }
539 paranoid_free(command);
540
541 maxpc = 100;
542// OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
543 for (sleep(1); does_file_exist(tempfile); sleep(1)) {
544 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
545 if (pcno < 0 || pcno > 100) {
546 log_msg(5, "Weird pc#");
547 continue;
548 }
549 percentage = pcno * 100 / maxpc;
550 if (pcno <= 5 && last_pcno > 40) {
551 close_evalcall_form();
552 open_evalcall_form("_(Verifying...");
553 }
554 last_pcno = pcno;
555 update_evalcall_form(percentage);
556 }
557// OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
558 close_evalcall_form();
559 if (pclose(pin)) {
560 res++;
561 log_OS_error("Unable to pclose");
562 }
563 unlink(tempfile);
564 paranoid_free(tempfile);
565 return (res);
566}
567
568
569void *run_prog_in_bkgd_then_exit(void *info)
570{
571 char *sz_command;
572 static int res = 4444;
573
574 res = 999;
575 sz_command = (char *) info;
576 log_msg(4, "sz_command = '%s'", sz_command);
577 res = system(sz_command);
578 if (res > 256 && res != 4444) {
579 res = res / 256;
580 }
581 log_msg(4, "child res = %d", res);
582 sz_command[0] = '\0';
583 pthread_exit((void *) (&res));
584}
585
586
587int run_external_binary_with_percentage_indicator_NEW(char *tt, char *cmd)
588{
589
590 /*@ int *************************************************************** */
591 int res = 0;
592 int percentage = 0;
593 int maxpc = 100;
594 int pcno = 0;
595 int last_pcno = 0;
596 int counter = 0;
597
598 /*@ buffers *********************************************************** */
599 char *command;
600 /*@ pointers ********************************************************** */
601 static int chldres = 0;
602 int *pchild_result;
603 pthread_t childthread;
604
605 pchild_result = &chldres;
606 assert_string_is_neither_NULL_nor_zerolength(cmd);
607 assert_string_is_neither_NULL_nor_zerolength(tt);
608 *pchild_result = 999;
609
610 asprintf(&command, "%s 2>> %s", cmd, MONDO_LOGFILE);
611 log_msg(3, "command = '%s'", command);
612 if ((res =
613 pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit,
614 (void *) command))) {
615 fatal_error("Unable to create an archival thread");
616 }
617
618 log_msg(8, "Parent running");
619 open_evalcall_form(tt);
620 for (sleep(1); command[0] != '\0'; sleep(1)) {
621 pcno = grab_percentage_from_last_line_of_file(MONDO_LOGFILE);
622 if (pcno <= 0 || pcno > 100) {
623 log_msg(8, "Weird pc#");
624 continue;
625 }
626 percentage = pcno * 100 / maxpc;
627 if (pcno <= 5 && last_pcno >= 40) {
628 close_evalcall_form();
629 open_evalcall_form(_("Verifying..."));
630 }
631 if (counter++ >= 5) {
632 counter = 0;
633 log_file_end_to_screen(MONDO_LOGFILE, "");
634 }
635 last_pcno = pcno;
636 update_evalcall_form(percentage);
637 }
638 paranoid_free(command);
639
640 log_file_end_to_screen(MONDO_LOGFILE, "");
641 close_evalcall_form();
642 pthread_join(childthread, (void *) (&pchild_result));
643 if (pchild_result) {
644 res = *pchild_result;
645 } else {
646 res = 666;
647 }
648 log_msg(3, "Parent res = %d", res);
649 return (res);
650}
651
652
653/**
654 * Feed @p input_fifo through ntfsclone (restore) to @p output_device.
655 * @param input_fifo The ntfsclone file to read.
656 * @param output_device Where to put the output.
657 * @return The return value of ntfsclone (0 for success).
658 */
659int feed_outfrom_ntfsprog(char *output_device, char *input_fifo)
660{
661// RESTORE
662 int res = -1;
663 char *command = NULL;
664 char *tmp = NULL;
665
666 tmp = find_home_of_exe("ntfsclone");
667 if (!tmp) {
668 fatal_error("ntfsclone not found");
669 }
670 paranoid_free(tmp);
671
672 asprintf(&command, "ntfsclone --force --restore-image --overwrite %s %s", output_device, input_fifo);
673 res = run_program_and_log_output(command, 5);
674 paranoid_free(command);
675 return (res);
676}
Note: See TracBrowser for help on using the repository browser.