Changeset 1625 in MondoRescue for branches/stable
- Timestamp:
- Sep 9, 2007, 1:00:49 AM (18 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-fork.c
r1609 r1625 7 7 #include "mr_str.h" 8 8 #include "mr_gettext.h" 9 #include "mr_conf.h" 9 10 10 11 #include "mondostructures.h" … … 23 24 extern char *MONDO_LOGFILE; 24 25 pid_t g_buffer_pid = 0; 25 26 extern struct mr_ar_conf *mr_conf = NULL; 26 27 27 28 /** … … 178 179 * Run a program and log its output (stdout and stderr) to the logfile. 179 180 * @param program The program to run. Passed to the shell, so you can use pipes etc. 180 * @param debug_level If @p g_loglevel is higher than this, do not log the output.181 * @param debug_level If @p log_level is higher than this, do not log the output. 181 182 * @return The exit code of @p program (depends on the command, but 0 almost always indicates success). 182 183 */ … … 205 206 } 206 207 207 if (debug_level <= g_loglevel) {208 if (debug_level <= mr_conf->log_level) { 208 209 log_if_success = TRUE; 209 210 log_if_failure = TRUE; -
branches/stable/mondo/src/common/libmondo-tools-EXT.h
r1183 r1625 15 15 #endif 16 16 extern int some_basic_system_sanity_checks(void); 17 18 19 extern int g_loglevel;20 17 21 18 -
branches/stable/mondo/src/common/libmondo-tools.c
r1609 r1625 64 64 char *g_tmpfs_mountpt = NULL; 65 65 char *g_magicdev_command = NULL; 66 67 /**68 * The default maximum level to log messages at or below.69 */70 int g_loglevel = DEFAULT_DEBUG_LEVEL;71 66 72 67 /* @} - end of globalGroup */ -
branches/stable/mondo/src/include/my-stuff.h
r1594 r1625 294 294 #define log_it(format, args...) mr_msg(2, format, ## args) 295 295 296 #define DEFAULT_DEBUG_LEVEL 4 ///< By default, don't log messages with a loglevel higher than this.297 #define DEFAULT_MR_LOGLEVEL 4298 299 296 #define SZ_NTFSPROG_VOLSIZE "1048576" // was 4096 300 297 #define NTFSPROG_PARAMS "-z0 -V" SZ_NTFSPROG_VOLSIZE " -o -b -d -g1" -
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r1609 r1625 19 19 #include "mr_msg.h" 20 20 #include "mr_gettext.h" 21 #include "mr_conf.h" 21 22 22 23 //static char cvsid[] = "$Id$"; 23 24 24 extern int g_loglevel;25 25 extern bool g_text_mode; 26 26 extern char g_startdir[MAX_STR_LEN]; ///< ????? @bug ????? … … 28 28 extern char g_tmpfs_mountpt[MAX_STR_LEN]; 29 29 extern bool g_sigpipe; 30 31 extern struct mr_ar_conf *mr_conf = NULL; 30 32 31 33 /*@ file pointer **************************************************/ … … 220 222 } 221 223 if (flag_set['K']) { 222 g_loglevel = atoi(flag_val['K']);223 if ( g_loglevel < 3) {224 g_loglevel = 3;224 mr_conf->log_level = atoi(flag_val['K']); 225 if (mr_conf->log_level < 3) { 226 mr_conf->log_level = 3; 225 227 } 226 228 } -
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1594 r1625 49 49 extern char *g_magicdev_command; 50 50 extern t_bkptype g_backup_media_type; 51 extern int g_loglevel;52 51 53 52 extern char *get_uname_m(void); … … 501 500 502 501 if (argc == 4 && !strcmp(argv[1], "getfattr")) { 503 g_loglevel = 10;502 mr_conf->log_level = 10; 504 503 g_text_mode = TRUE; 505 504 setup_newt_stuff(); … … 513 512 } 514 513 if (argc == 4 && !strcmp(argv[1], "setfattr")) { 515 g_loglevel = 10;514 mr_conf->log_level = 10; 516 515 g_text_mode = TRUE; 517 516 setup_newt_stuff(); … … 520 519 521 520 if (argc == 3 && !strcmp(argv[1], "wildcards")) { 522 g_loglevel = 10;521 mr_conf->log_level = 10; 523 522 g_text_mode = TRUE; 524 523 setup_newt_stuff(); … … 530 529 531 530 if (argc == 4 && !strcmp(argv[1], "getfacl")) { 532 g_loglevel = 10;531 mr_conf->log_level = 10; 533 532 g_text_mode = TRUE; 534 533 setup_newt_stuff(); … … 542 541 } 543 542 if (argc == 4 && !strcmp(argv[1], "setfacl")) { 544 g_loglevel = 10;543 mr_conf->log_level = 10; 545 544 g_text_mode = TRUE; 546 545 setup_newt_stuff(); … … 549 548 550 549 if (argc > 2 && !strcmp(argv[1], "find-cd")) { 551 g_loglevel = 10;550 mr_conf->log_level = 10; 552 551 g_text_mode = TRUE; 553 552 setup_newt_stuff(); … … 569 568 570 569 if (argc > 2 && !strcmp(argv[1], "find-dvd")) { 571 g_loglevel = 10;570 mr_conf->log_level = 10; 572 571 g_text_mode = TRUE; 573 572 setup_newt_stuff(); -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1621 r1625 32 32 #include "mondo-rstr-tools-EXT.h" 33 33 34 #define DEFAULT_MR_LOGLEVEL 4 35 34 36 extern void twenty_seconds_til_yikes(void); 37 extern struct mr_ar_conf *mr_conf = NULL; 35 38 36 39 … … 1013 1016 struct s_node *node = NULL; 1014 1017 1015 old_loglevel = g_loglevel;1018 old_loglevel = mr_conf->log_level; 1016 1019 ubuf = &the_utime_buf; 1017 1020 assert(bkpinfo != NULL); … … 1076 1079 if (biggiestruct.use_ntfsprog) // if it's an NTFS device 1077 1080 { 1078 g_loglevel = 4;1081 mr_conf->log_level = 4; 1079 1082 use_ntfsprog_hack = TRUE; 1080 1083 mr_msg(2, … … 1241 1244 } 1242 1245 paranoid_fclose(fout); 1243 g_loglevel = old_loglevel;1246 mr_conf->log_level = old_loglevel; 1244 1247 1245 1248 if (use_ntfsprog_hack) { … … 1317 1320 ubuf = &the_utime_buf; 1318 1321 1319 old_loglevel = g_loglevel;1322 old_loglevel = mr_conf->log_level; 1320 1323 assert(bkpinfo != NULL); 1321 1324 assert(orig_bf_fname != NULL); … … 1365 1368 1366 1369 if (use_ntfsprog) { 1367 g_loglevel = 4;1370 mr_conf->log_level = 4; 1368 1371 mr_asprintf(&outfile_fname, orig_bf_fname); 1369 1372 use_ntfsprog_hack = TRUE; … … 1507 1510 } 1508 1511 1509 g_loglevel = old_loglevel;1512 mr_conf->log_level = old_loglevel; 1510 1513 return (retval); 1511 1514 } … … 2817 2820 } 2818 2821 2819 g_loglevel = DEFAULT_MR_LOGLEVEL;2822 mr_conf->log_level = DEFAULT_MR_LOGLEVEL; 2820 2823 2821 2824 /* Configure global variables */ … … 2926 2929 } 2927 2930 2928 g_loglevel = DEFAULT_MR_LOGLEVEL;2931 mr_conf->log_level = DEFAULT_MR_LOGLEVEL; 2929 2932 if (argc == 3 && strcmp(argv[1], "--echo-to-screen") == 0) { 2930 2933 fout = fopen("/tmp/out.txt", "w"); … … 2958 2961 2959 2962 if (argc == 5 && strcmp(argv[1], "--common") == 0) { 2960 g_loglevel = 6;2963 mr_conf->log_level = 6; 2961 2964 filelist = load_filelist(argv[2]); 2962 2965 if (!filelist) { … … 2986 2989 if (argc == 5 && strcmp(argv[1], "--copy") == 0) { 2987 2990 mr_msg(1, "SCORE"); 2988 g_loglevel = 10;2991 mr_conf->log_level = 10; 2989 2992 if (strstr(argv[2], "save")) { 2990 2993 mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
Note:
See TracChangeset
for help on using the changeset viewer.