Changeset 2323 in MondoRescue for branches/2.2.10/mondo/src/common/newt-specific.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/newt-specific.c
r2321 r2323 276 276 char *tmp1 = NULL; 277 277 278 mr_asprintf( &tmp,"ps %s | grep \" %s \" | awk '{print %s;}' | grep -v \"grep\"", ps_options, str , ps_proc_id);278 mr_asprintf(tmp,"ps %s | grep \" %s \" | awk '{print %s;}' | grep -v \"grep\"", ps_options, str , ps_proc_id); 279 279 run_program_and_log_output(tmp, TRUE); 280 280 if (strlen(tmp) > 0) { 281 mr_asprintf( &tmp1,"kill `%s`", tmp);281 mr_asprintf(tmp1,"kill `%s`", tmp); 282 282 run_program_and_log_output(tmp1, TRUE); 283 283 mr_free(tmp1); … … 334 334 chdir("/"); 335 335 if (g_selfmounted_isodir) { 336 mr_asprintf( &command, "umount %s", g_selfmounted_isodir);336 mr_asprintf(command, "umount %s", g_selfmounted_isodir); 337 337 run_program_and_log_output(command, 5); 338 338 mr_free(command); 339 mr_asprintf( &command, "rmdir %s", g_selfmounted_isodir);339 mr_asprintf(command, "rmdir %s", g_selfmounted_isodir); 340 340 run_program_and_log_output(command, 5); 341 341 mr_free(command); … … 386 386 run_program_and_log_output("umount " MNT_CDROM, FALSE); 387 387 if (g_selfmounted_isodir) { 388 mr_asprintf( &command, "umount %s", g_selfmounted_isodir);388 mr_asprintf(command, "umount %s", g_selfmounted_isodir); 389 389 run_program_and_log_output(command, 1); 390 390 mr_free(command); 391 391 392 mr_asprintf( &command, "rmdir %s", g_selfmounted_isodir);392 mr_asprintf(command, "rmdir %s", g_selfmounted_isodir); 393 393 run_program_and_log_output(command, 1); 394 394 mr_free(command); … … 409 409 if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) { 410 410 log_msg(8,"erasing tempdir"); 411 mr_asprintf( &command, "rm -Rf %s", bkpinfo->tmpdir);411 mr_asprintf(command, "rm -Rf %s", bkpinfo->tmpdir); 412 412 system(command); 413 413 mr_free(command); … … 418 418 if (strstr(bkpinfo->scratchdir ,"mondo.scratch.") != NULL) { 419 419 log_msg(8,"erasing scratchdir"); 420 mr_asprintf( &command, "rm -Rf %s", bkpinfo->scratchdir);420 mr_asprintf(command, "rm -Rf %s", bkpinfo->scratchdir); 421 421 system(command); 422 422 mr_free(command); … … 754 754 /* take default if ENTER was typed */ 755 755 mr_free(output); 756 mr_asprintf( &output, "%s", input);756 mr_asprintf(output, "%s", input); 757 757 } 758 758 if (output[strlen(output) - 1] == '\n') … … 761 761 } 762 762 763 mr_asprintf( &blurb, "%s", b);763 mr_asprintf(blurb, "%s", b); 764 764 text = newtTextboxReflowed(2, 1, blurb, 48, 5, 5, 0); 765 765 type_here = … … 782 782 783 783 if (b_res == b_1) { 784 mr_asprintf( &output, "%s", newtEntryGetValue(type_here));784 mr_asprintf(output, "%s", newtEntryGetValue(type_here)); 785 785 } 786 786 newtPopHelpLine(); … … 982 982 || percentage > g_isoform_old_progress) { 983 983 g_isoform_old_progress = percentage; 984 mr_asprintf( &timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60);984 mr_asprintf(timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60); 985 985 if (percentage < 3) { 986 mr_asprintf( &pcline_str, " Working");986 mr_asprintf(pcline_str, " Working"); 987 987 for (j = 0; j < g_mysterious_dot_counter; j++) { 988 988 mr_strcat(pcline_str, "."); … … 993 993 mr_strcat(pcline_str, " %c", special_dot_char(g_mysterious_dot_counter)); 994 994 } else { 995 mr_asprintf( &pcline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage);995 mr_asprintf(pcline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage); 996 996 } 997 997 if (g_text_mode) { 998 mr_asprintf( &taskprogress, "TASK: [");998 mr_asprintf(taskprogress, "TASK: ["); 999 999 for (i = 0; i < percentage; i += 5) { 1000 1000 mr_strcat(taskprogress, "*"); … … 1117 1117 printf("---progress-form---3--- %s\n", blurb3); 1118 1118 printf("---progress-form---E---\n"); 1119 mr_asprintf( &taskprogress, "TASK: [");1119 mr_asprintf(taskprogress, "TASK: ["); 1120 1120 for (i = 0; i < percentage; i += 5) { 1121 1121 mr_strcat(taskprogress, "*"); … … 1131 1131 paranoid_free(taskprogress); 1132 1132 } else { 1133 mr_asprintf( &timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining ", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60);1134 mr_asprintf( &percentline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage);1133 mr_asprintf(timeline_str, "%2ld:%02ld taken %2ld:%02ld remaining ", (long) time_taken / 60, (long) time_taken % 60, (long) time_remaining / 60, (long) time_remaining % 60); 1134 mr_asprintf(percentline_str, " %3d%% done %3d%% to go", percentage, 100 - percentage); 1135 1135 1136 1136 center_string(blurb1, 54); … … 1359 1359 } 1360 1360 1361 mr_asprintf( &tmp1,"%s/icantfindthesefiles.txt",bkpinfo->tmpdir);1361 mr_asprintf(tmp1,"%s/icantfindthesefiles.txt",bkpinfo->tmpdir); 1362 1362 if (!(fout = fopen(tmp1, "a"))) { 1363 1363 log_msg(2, "Can't write to %s", tmp1); … … 1453 1453 assert(flentry != NULL); 1454 1454 if (flentry->severity == 0) { 1455 mr_asprintf( &tmp, "0 ");1455 mr_asprintf(tmp, "0 "); 1456 1456 } else if (flentry->severity == 1) { 1457 mr_asprintf( &tmp, "low ");1457 mr_asprintf(tmp, "low "); 1458 1458 } else if (flentry->severity == 2) { 1459 mr_asprintf( &tmp, "med ");1460 } else { 1461 mr_asprintf( &tmp, "high");1459 mr_asprintf(tmp, "med "); 1460 } else { 1461 mr_asprintf(tmp, "high"); 1462 1462 } 1463 1463 mr_strcat(tmp, " "); … … 1540 1540 keylist[i]); 1541 1541 } 1542 mr_asprintf( &differ_sz, " %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.", i);1542 mr_asprintf(differ_sz, " %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.", i); 1543 1543 newtPushHelpLine(differ_sz); 1544 1544 mr_free(differ_sz); … … 1546 1546 bClose = newtCompactButton(10, 15, " Close "); 1547 1547 bSelect = newtCompactButton(30, 15, " Select "); 1548 mr_asprintf( &tmp, "%-10s %-20s", "Priority", "Filename");1548 mr_asprintf(tmp, "%-10s %-20s", "Priority", "Filename"); 1549 1549 headerMsg = newtLabel(2, 1, tmp); 1550 1550 mr_free(tmp); … … 1571 1571 if (filelist->entries > 0) { 1572 1572 severity_of_difference(filelist->el[currline]. filename, reason); 1573 mr_asprintf( &tmp, "%s --- %s", filelist->el[currline].filename, reason);1573 mr_asprintf(tmp, "%s --- %s", filelist->el[currline].filename, reason); 1574 1574 1575 1575 popup_and_OK(tmp);
Note:
See TracChangeset
for help on using the changeset viewer.