Changeset 1663 in MondoRescue for branches/stable/mondo/src/mondoarchive/mondo-cli.c
- Timestamp:
- Sep 27, 2007, 12:21:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r1639 r1663 25 25 extern bool g_text_mode; 26 26 extern char g_startdir[MAX_STR_LEN]; ///< ????? @bug ????? 27 extern char g_erase_tmpdir_and_scratchdir[MAX_STR_LEN];28 27 extern char g_tmpfs_mountpt[MAX_STR_LEN]; 29 28 extern bool g_sigpipe; … … 44 43 bool g_running_live = FALSE; ///< ????? @bug ????? @ingroup globalGroup 45 44 extern bool g_cd_recovery; 45 46 extern void setup_tmpdir(char *path); 46 47 47 48 /** … … 63 64 char *g_getfacl = NULL; 64 65 char *g_getfattr = NULL; 66 67 /* Reference to global bkpinfo */ 68 extern struct s_bkpinfo *bkpinfo; 65 69 66 70 /** … … 76 80 */ 77 81 int 78 handle_incoming_parameters(int argc, char *argv[], 79 struct s_bkpinfo *bkpinfo) 82 handle_incoming_parameters(int argc, char *argv[]) 80 83 { 81 84 /*@ int *** */ … … 89 92 bool flag_set[128]; 90 93 91 sensibly_set_tmpdir_and_scratchdir( bkpinfo);94 sensibly_set_tmpdir_and_scratchdir(); 92 95 93 96 for (i = 0; i < 128; i++) { … … 99 102 retval += res; 100 103 if (!retval) { 101 res = process_switches( bkpinfo,flag_val, flag_set);104 res = process_switches(flag_val, flag_set); 102 105 retval += res; 103 106 } … … 121 124 mr_free(tmp); 122 125 123 sprintf(bkpinfo->tmpdir + strlen(bkpinfo->tmpdir), "/tmp.mondo.%ld",124 random() % 32767);125 126 sprintf(bkpinfo->scratchdir + strlen(bkpinfo->scratchdir), 126 127 "/mondo.scratch.%ld", random() % 32767); … … 144 145 * @bug Return code not needed. 145 146 */ 146 int process_the_s_switch( struct s_bkpinfo *bkpinfo,char *value)147 int process_the_s_switch(char *value) 147 148 { 148 149 char *tmp = NULL; … … 180 181 */ 181 182 int 182 process_switches(struct s_bkpinfo *bkpinfo, 183 char flag_val[128][MAX_STR_LEN], bool flag_set[128]) 183 process_switches(char flag_val[128][MAX_STR_LEN], bool flag_set[128]) 184 184 { 185 185 … … 425 425 ("For the moment, please don't specify a tape size. Mondo should handle end-of-tape gracefully anyway."); 426 426 } 427 if (process_the_s_switch( bkpinfo,flag_val['s'])) {427 if (process_the_s_switch(flag_val['s'])) { 428 428 fatal_error("Bad -s switch"); 429 429 } … … 438 438 } else { /* CD|USB size */ 439 439 if (flag_set['s']) { 440 if (process_the_s_switch( bkpinfo,flag_val['s'])) {440 if (process_the_s_switch(flag_val['s'])) { 441 441 fatal_error("Bad -s switch"); 442 442 } … … 672 672 } 673 673 if (flag_set['T']) { 674 sprintf(bkpinfo->tmpdir, "%s/tmp.mondo.%ld", flag_val['T'], 675 random() % 32768); 674 setup_tmpdir(flag_val['T']); 676 675 mr_asprintf(&tmp2, "touch %s/.foo.dat", flag_val['T']); 677 676 if (run_program_and_log_output(tmp2, 1)) { … … 683 682 mr_free(tmp2); 684 683 685 mr_asprintf(&tmp2, "ln -sf %s/.foo.dat %s/.bar.dat", flag_val['T'], 686 flag_val['T']); 684 mr_asprintf(&tmp2, "ln -sf %s/.foo.dat %s/.bar.dat", bkpinfo->tmpdir, bkpinfo->tmpdir); 687 685 if (run_program_and_log_output(tmp2, 1)) { 688 686 retval++;
Note:
See TracChangeset
for help on using the changeset viewer.