Changeset 783 in MondoRescue for trunk/mondo/mondo/common/newt-specific.c
- Timestamp:
- Aug 31, 2006, 5:09:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/newt-specific.c
r764 r783 14 14 15 15 #include <unistd.h> 16 #include <math.h> 16 17 17 18 #include "my-stuff.h" … … 28 29 //static char cvsid[] = "$Id$"; 29 30 30 31 32 33 34 31 extern pid_t g_mastermind_pid; 32 extern char *g_tmpfs_mountpt; 33 extern char *g_mondo_home; 34 35 extern void set_signals(int); 35 36 36 37 /** … … 41 42 * Whether we are currently in a nested call of fatal_error(). 42 43 */ 43 44 45 46 47 48 49 50 51 52 44 bool g_exiting = FALSE; 45 46 newtComponent g_timeline = NULL, ///< The line of the progress form that shows the time elapsed/remaining 47 g_percentline = NULL, ///< The line of the progress form that shows the percent completed/remaining 48 g_scale = NULL, ///< The progress bar component in the progress form 49 g_progressForm = NULL, ///< The progress form component itself 50 g_blurb1 = NULL, ///< The component for line 1 of the blurb in the progress form 51 g_blurb2 = NULL, ///< The component for line 2 of the blurb in the progress form 52 g_blurb3 = NULL, ///< The component for line 3 (updated continuously) of the blurb in the progress form 53 g_label = NULL; ///< ????? @bug ????? 53 54 54 55 /** 55 56 * Padding above the Newt components, to overcome bugs in Newt. 56 57 */ 57 58 59 60 58 char **err_log_lines = NULL, ///< The list of log lines to show on the screen. 59 *g_blurb_str_1, ///< The string for line 1 of the blurb in the progress form 60 *g_blurb_str_2, ///< The string for line 2 of the blurb in the progress form 61 *g_blurb_str_3; ///< The string for line 3 (updated continuously) of the blurb in the progress form 61 62 newtComponent g_isoform_main = NULL, ///< The evalcall form component itself 62 63 64 65 66 67 68 69 70 71 72 73 74 63 g_isoform_header = NULL, ///< The component for the evalcall form title 64 g_isoform_scale = NULL, ///< The progress bar component in the evalcall form 65 g_isoform_timeline = NULL, ///< The line of the evalcall form that shows the time elapsed/remaining 66 g_isoform_pcline = NULL; ///< The line of the evalcall form that shows the percent completed/remaining 67 long g_isoform_starttime; ///< The time (in seconds since the epoch) that the evalcall form was opened. 68 int g_isoform_old_progress = -1; ///< The most recent progress update of the evalcall form (percent). 69 char *g_isoform_header_str; ///< The string for the evalcall form title. 70 int g_mysterious_dot_counter; ///< The counter for the twirling baton (/ | \\ - ...) on percentage less than 3 71 int g_noof_log_lines = 6; ///< The number of lines to show in the log at the bottom of the screen. 72 int g_noof_rows = 25; ///< The number of rows on the screen. 73 74 int g_currentY = 3; ///< The row to write background progress messages to. Incremented each time a message is written. 75 extern int g_current_media_number; 75 76 pid_t g_main_pid = 0; ///< The PID of the main Mondo process. 76 77 78 79 80 81 82 char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.77 long g_maximum_progress = 999; ///< The maximum amount of progress (100%) for the currently opened progress form. 78 long g_current_progress = -999; ///< The current amount of progress (filelist #, etc.) for the currently opened progress form. 79 long g_start_time = 0; ///< The time (in seconds since the epoch) that the progress form was opened. 80 bool g_text_mode = TRUE; ///< If FALSE, use a newt interface; if TRUE, use an ugly (but more compatible) dumb terminal interface. 81 bool g_called_by_xmondo = FALSE; ///< @bug Unneeded w/current XMondo. 82 char *g_erase_tmpdir_and_scratchdir; ///< The command to run to erase the tmpdir and scratchdir at the end of Mondo. 83 char *g_selfmounted_isodir = NULL; ///< Holds the NFS mountpoint if mounted via mondoarchive. 83 84 84 85 /* @} - end of globalGroup */ … … 86 87 //int g_fd_in=-1, g_fd_out=-1; 87 88 88 89 void popup_and_OK(char *); 89 90 90 91 … … 280 281 kill_anything_like_this("ntfsclone"); 281 282 sync(); 282 asprintf(&tmp, "umount %s", g_tmpfs_mountpt); 283 chdir("/"); 284 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 285 log_msg(2, "Waiting for child processes to terminate"); 286 sleep(1); 287 run_program_and_log_output(tmp, 5); 288 } 289 paranoid_free(tmp); 283 if (g_tmpfs_mountpt != NULL) { 284 asprintf(&tmp, "umount %s", g_tmpfs_mountpt); 285 chdir("/"); 286 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 287 log_msg(2, "Waiting for child processes to terminate"); 288 sleep(1); 289 run_program_and_log_output(tmp, 5); 290 } 291 paranoid_free(tmp); 292 } 290 293 291 294 if (g_erase_tmpdir_and_scratchdir) { … … 298 301 asprintf(&command, "rmdir %s", g_selfmounted_isodir); 299 302 run_program_and_log_output(command, 5); 303 paranoid_free(g_selfmounted_isodir); 300 304 } 301 305 … … 356 360 asprintf(&command, "rmdir %s", g_selfmounted_isodir); 357 361 run_program_and_log_output(command, 1); 362 paranoid_free(g_selfmounted_isodir); 358 363 } 359 364 // iamhere("foo"); … … 469 474 470 475 if (err_log_lines) { 471 paranoid_free( &err_log_lines[0]);476 paranoid_free(err_log_lines[0]); 472 477 for (i = 1; i < g_noof_log_lines; i++) { 473 478 err_log_lines[i - 1] = err_log_lines[i]; … … 676 681 677 682 /*@ pointers ********************************************************* */ 678 char * entry_value = NULL;683 char **entry_value = NULL; 679 684 680 685 /*@ buffers ********************************************************** */ … … 702 707 newtEntry(2, newtTextboxGetNumLines(text) + 2, 703 708 output, 50, 704 &entry_value, NEWT_FLAG_RETURNEXIT709 entry_value, NEWT_FLAG_RETURNEXIT 705 710 ); 706 711 b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, _(" OK ")); … … 721 726 // Copy entry_value before destroying the form 722 727 // clearing potentially output before 723 paranoid_alloc(output, entry_value);728 paranoid_alloc(output,*entry_value); 724 729 } 725 730 newtFormDestroy(myForm);
Note:
See TracChangeset
for help on using the changeset viewer.