Changeset 3208 in MondoRescue for branches/3.2/mondo/src/mondoarchive/mondoarchive.c
- Timestamp:
- Dec 10, 2013, 8:50:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/mondoarchive/mondoarchive.c
r3194 r3208 165 165 FILE *fin = NULL; 166 166 167 /* Make sure I'm root; abort if not */167 /* Make sure I'm root; abort if not */ 168 168 if (getuid() != 0) { 169 169 fprintf(stderr, "Please run as root.\r\n"); 170 exit(127);171 } 172 173 /* If -V, -v or --version then echo version no. and quit */170 finish(127); 171 } 172 173 /* If -V, -v or --version then echo version no. and quit */ 174 174 if (argc == 2 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") || !strcmp(argv[argc - 1], "--version"))) { 175 175 printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION); 176 exit(0); 177 } 178 179 /* Initialize variables */ 180 181 printf("Initializing...\n"); 182 if (!(bkpinfo = (struct s_bkpinfo *)malloc(sizeof(struct s_bkpinfo)))) { 183 fatal_error("Cannot malloc bkpinfo"); 184 } 185 reset_bkpinfo(); 186 187 /* Memory allocation is done in those functions */ 188 malloc_libmondo_global_strings(); 176 finish(0); 177 } 189 178 190 179 /* initialize log file with time stamp */ 191 180 unlink(MONDO_LOGFILE); 192 181 log_msg(0, "Time started: %s", mr_date()); 182 183 /* Initialize variables */ 184 if (!(bkpinfo = (struct s_bkpinfo *)malloc(sizeof(struct s_bkpinfo)))) { 185 fprintf(stderr, "Cannot malloc bkpinfo\n"); 186 finish(-1); 187 } 188 log_msg(9, "reset_bkpinfo"); 189 reset_bkpinfo(); 190 191 /* Memory allocation is done in those functions */ 192 malloc_libmondo_global_strings(); 193 193 194 194 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ … … 351 351 } 352 352 353 /* Finish configuring global structures */353 /* Finish configuring global structures */ 354 354 if (post_param_configuration()) { 355 355 fatal_error("Post-param initialization phase failed. Perhaps bad parameters were supplied to mondoarchive? Please review the documentation, error messages and logs. Exiting...");
Note:
See TracChangeset
for help on using the changeset viewer.