Changeset 2323 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-fork.c
- Timestamp:
- Aug 18, 2009, 3:05:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2316 r2323 125 125 126 126 if (bkpinfo->nfs_user) { 127 mr_asprintf( &tmp1, "su - %s -c \"%s\"", bkpinfo->nfs_user, basic_call);127 mr_asprintf(tmp1, "su - %s -c \"%s\"", bkpinfo->nfs_user, basic_call); 128 128 } else { 129 mr_asprintf( &tmp1, "%s", basic_call);130 } 131 132 mr_asprintf( &cd_number_str, "%d", cd_no);129 mr_asprintf(tmp1, "%s", basic_call); 130 } 131 132 mr_asprintf(cd_number_str, "%d", cd_no); 133 133 log_msg(4, "basic call = '%s'", tmp1); 134 134 midway_call = resolve_naff_tokens(tmp1, isofile, "_ISO_"); … … 145 145 146 146 log_msg(4, "ultimate call = '%s'", ultimate_call); 147 mr_asprintf( &command, "%s >> %s", ultimate_call, MONDO_LOGFILE);147 mr_asprintf(command, "%s >> %s", ultimate_call, MONDO_LOGFILE); 148 148 mr_free(ultimate_call); 149 149 … … 153 153 what_i_am_doing); 154 154 if (bkpinfo->manual_cd_tray) { 155 mr_asprintf( &tmp2, "%s", command);155 mr_asprintf(tmp2, "%s", command); 156 156 p = strstr(tmp2, "2>>"); 157 157 if (p) { … … 272 272 log_if_failure = TRUE; 273 273 } 274 mr_asprintf( &callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir);274 mr_asprintf(callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir); 275 275 while ((p = strchr(callstr, '\r'))) { 276 276 *p = ' '; … … 288 288 mr_free(callstr); 289 289 290 mr_asprintf( &callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);290 mr_asprintf(callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir); 291 291 if (log_if_failure && system(callstr)) { 292 292 log_OS_error("Command failed"); … … 294 294 mr_free(callstr); 295 295 296 mr_asprintf( &tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir);296 mr_asprintf(tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir); 297 297 unlink(tmp1); 298 298 mr_free(tmp1); 299 299 300 mr_asprintf( &tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir);300 mr_asprintf(tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir); 301 301 fin = fopen(tmp1, "r"); 302 302 if (fin) { … … 363 363 assert_string_is_neither_NULL_nor_zerolength(basic_call); 364 364 365 mr_asprintf( &lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir);366 367 mr_asprintf( &command, "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile);365 mr_asprintf(lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir); 366 367 mr_asprintf(command, "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile); 368 368 open_evalcall_form(what_i_am_doing); 369 mr_asprintf( &tmp, "Executing %s", basic_call);369 mr_asprintf(tmp, "Executing %s", basic_call); 370 370 log_msg(2, tmp); 371 371 mr_free(tmp); … … 373 373 if (!(fin = popen(command, "r"))) { 374 374 log_OS_error("Unable to popen-in command"); 375 mr_asprintf( &tmp, "Failed utterly to call '%s'", command);375 mr_asprintf(tmp, "Failed utterly to call '%s'", command); 376 376 log_to_screen(tmp); 377 377 mr_free(tmp); … … 463 463 fin = f_orig; 464 464 fout = f_archived; 465 mr_asprintf( &tmp, "%-64s", PIMP_START_SZ);465 mr_asprintf(tmp, "%-64s", PIMP_START_SZ); 466 466 if (fwrite(tmp, 1, 64, fout) != 64) { 467 467 mr_free(tmp); … … 475 475 break; 476 476 } 477 mr_asprintf( &tmp, "%-64ld", bytes_read_in);477 mr_asprintf(tmp, "%-64ld", bytes_read_in); 478 478 if (fwrite(tmp, 1, 64, fout) != 64) { 479 479 mr_free(tmp); … … 486 486 subsliceno, bytes_read_in, bytes_to_be_read); 487 487 bytes_written_out += fwrite(buf, 1, bytes_read_in, fout); 488 mr_asprintf( &tmp, "%-64ld", subsliceno);488 mr_asprintf(tmp, "%-64ld", subsliceno); 489 489 if (fwrite(tmp, 1, 64, fout) != 64) { 490 490 mr_free(tmp); … … 495 495 subsliceno++; 496 496 } 497 mr_asprintf( &tmp, "%-64ld", 0L);497 mr_asprintf(tmp, "%-64ld", 0L); 498 498 if (fwrite(tmp, 1, 64L, fout) != 64L) { 499 499 mr_free(tmp); … … 502 502 mr_free(tmp); 503 503 504 mr_asprintf( &tmp, "%-64s", PIMP_END_SZ);504 mr_asprintf(tmp, "%-64s", PIMP_END_SZ); 505 505 if (fwrite(tmp, 1, 64, fout) != 64) { 506 506 mr_free(tmp); … … 559 559 log_msg(5, "tmpB is %s", tmp1); 560 560 if (!strstr(tmp1, PIMP_END_SZ)) { 561 mr_asprintf( &filestr, "%s/out.leftover", bkpinfo->tmpdir);561 mr_asprintf(filestr, "%s/out.leftover", bkpinfo->tmpdir); 562 562 ftmp = fopen(filestr, "w"); 563 563 mr_free(filestr); … … 604 604 fatal_error("ntfsclone not found"); 605 605 } 606 mr_asprintf( &command, "ntfsclone --force --save-image --overwrite %s %s", output_fname, input_device);606 mr_asprintf(command, "ntfsclone --force --save-image --overwrite %s %s", output_fname, input_device); 607 607 res = run_program_and_log_output(command, 5); 608 608 mr_free(command); … … 659 659 malloc_string(title); 660 660 strcpy(title, tt); 661 mr_asprintf( &command, "%s 2>> %s", cmd, MONDO_LOGFILE);661 mr_asprintf(command, "%s 2>> %s", cmd, MONDO_LOGFILE); 662 662 log_msg(3, "command = '%s'", command); 663 663 if ((res = pthread_create(&childthread, NULL, run_prog_in_bkgd_then_exit, (void *) command))) { … … 719 719 fatal_error("ntfsclone not found"); 720 720 } 721 mr_asprintf( &command, "ntfsclone --force --restore-image --overwrite %s %s", output_device, input_fifo);721 mr_asprintf(command, "ntfsclone --force --restore-image --overwrite %s %s", output_device, input_fifo); 722 722 res = run_program_and_log_output(command, 5); 723 723 mr_free(command);
Note:
See TracChangeset
for help on using the changeset viewer.