Changeset 3185 in MondoRescue for branches/3.0/mondo/src/common/newt-specific.c
- Timestamp:
- Sep 20, 2013, 2:29:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/newt-specific.c
r3154 r3185 296 296 char *tmp1 = NULL; 297 297 298 mr_asprintf( &tmp,"ps %s | grep \" %s \" | grep -v \"grep\" | awk '{print %s;}'", ps_options, str , ps_proc_id);298 mr_asprintf(tmp,"ps %s | grep \" %s \" | grep -v \"grep\" | awk '{print %s;}'", ps_options, str , ps_proc_id); 299 299 run_program_and_log_output(tmp, TRUE); 300 300 if (strlen(tmp) > 0) { 301 mr_asprintf( &tmp1,"kill `%s`", tmp);301 mr_asprintf(tmp1,"kill `%s`", tmp); 302 302 run_program_and_log_output(tmp1, TRUE); 303 303 paranoid_free(tmp1); … … 434 434 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 435 435 if (g_selfmounted_isodir) { 436 mr_asprintf( &command, "umount -d %s", g_selfmounted_isodir);436 mr_asprintf(command, "umount -d %s", g_selfmounted_isodir); 437 437 run_program_and_log_output(command, 1); 438 438 paranoid_free(command); 439 mr_asprintf( &command, "rmdir %s", g_selfmounted_isodir);439 mr_asprintf(command, "rmdir %s", g_selfmounted_isodir); 440 440 run_program_and_log_output(command, 1); 441 441 paranoid_free(command); … … 456 456 if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) { 457 457 log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir); 458 mr_asprintf( &command, "rm -Rf %s", bkpinfo->tmpdir);458 mr_asprintf(command, "rm -Rf %s", bkpinfo->tmpdir); 459 459 paranoid_system(command); 460 460 mr_free(command); … … 465 465 if (strstr(bkpinfo->scratchdir ,"mondo.scratch.") != NULL) { 466 466 log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir); 467 mr_asprintf( &command, "rm -Rf %s", bkpinfo->scratchdir);467 mr_asprintf(command, "rm -Rf %s", bkpinfo->scratchdir); 468 468 paranoid_system(command); 469 469 mr_free(command); … … 515 515 } 516 516 if (grep_for_me[0] != '\0') { 517 mr_asprintf( &command, "grep '%s' %s | tail -n%d",517 mr_asprintf(command, "grep '%s' %s | tail -n%d", 518 518 grep_for_me, filename, g_noof_log_lines); 519 519 } else { 520 mr_asprintf( &command, "tail -n%d %s", g_noof_log_lines,520 mr_asprintf(command, "tail -n%d %s", g_noof_log_lines, 521 521 filename); 522 522 } … … 536 536 */ 537 537 if (!strncmp(err_log_lines[i], "root:", 5)) { 538 mr_asprintf( &tmp, "%s", err_log_lines[i] + 6);538 mr_asprintf(tmp, "%s", err_log_lines[i] + 6); 539 539 strncpy(err_log_lines[i], tmp, (size_t)MAX_NEWT_COMMENT_LEN); 540 540 mr_free(tmp); … … 1074 1074 (long) time_remaining % 60); 1075 1075 if (percentage < 3) { 1076 mr_asprintf( &pcline_str, " Working");1076 mr_asprintf(pcline_str, " Working"); 1077 1077 for (j = 0; j < g_mysterious_dot_counter; j++) { 1078 1078 mr_strcat(pcline_str, "."); … … 1083 1083 mr_strcat(pcline_str, " %c", special_dot_char(g_mysterious_dot_counter)); 1084 1084 } else { 1085 mr_asprintf( &pcline_str, " %3d%% done %3d%% to go",1085 mr_asprintf(pcline_str, " %3d%% done %3d%% to go", 1086 1086 percentage, 100 - percentage); 1087 1087 } 1088 1088 if (g_text_mode) { 1089 mr_asprintf( &taskprogress, "TASK: [");1089 mr_asprintf(taskprogress, "TASK: ["); 1090 1090 for (i = 0; i < percentage; i += 5) { 1091 1091 mr_strcat(taskprogress, "*"); … … 1234 1234 printf("---progress-form---3--- %s\n", blurb3); 1235 1235 printf("---progress-form---E---\n"); 1236 mr_asprintf( &taskprogress, "TASK: [");1236 mr_asprintf(taskprogress, "TASK: ["); 1237 1237 for (i = 0; i < percentage; i += 5) { 1238 1238 mr_strcat(taskprogress, "*"); … … 1443 1443 newtPopWindow(); 1444 1444 if (b_res == b1) { 1445 mr_asprintf( &output, "%s", "bzip2");1445 mr_asprintf(output, "%s", "bzip2"); 1446 1446 } else if (b_res == b2) { 1447 mr_asprintf( &output, "%s", "gzip");1447 mr_asprintf(output, "%s", "gzip"); 1448 1448 } else if (b_res == b3) { 1449 mr_asprintf( &output, "%s", "lzo");1449 mr_asprintf(output, "%s", "lzo"); 1450 1450 //} else if (b_res == b4) { 1451 //mr_asprintf( &output, "%s", "lzma");1451 //mr_asprintf(output, "%s", "lzma"); 1452 1452 } 1453 1453 newtPopHelpLine(); … … 1540 1540 } 1541 1541 1542 mr_asprintf( &tmp1,"%s/icantfindthesefiles.txt",bkpinfo->tmpdir);1542 mr_asprintf(tmp1,"%s/icantfindthesefiles.txt",bkpinfo->tmpdir); 1543 1543 if (!(fout = fopen(tmp1, "a"))) { 1544 1544 log_msg(2, "Can't write to %s", tmp1); … … 1637 1637 assert(flentry != NULL); 1638 1638 if (flentry->severity == 0) { 1639 mr_asprintf( &tmp, "0 ");1639 mr_asprintf(tmp, "0 "); 1640 1640 } else if (flentry->severity == 1) { 1641 mr_asprintf( &tmp, "low ");1641 mr_asprintf(tmp, "low "); 1642 1642 } else if (flentry->severity == 2) { 1643 mr_asprintf( &tmp, "med ");1644 } else { 1645 mr_asprintf( &tmp, "high");1643 mr_asprintf(tmp, "med "); 1644 } else { 1645 mr_asprintf(tmp, "high"); 1646 1646 } 1647 1647 mr_strcat(tmp, " ");
Note:
See TracChangeset
for help on using the changeset viewer.