Changeset 2211 in MondoRescue for branches/2.2.9/mondo/src/mondoarchive
- Timestamp:
- Jun 3, 2009, 7:10:19 PM (16 years ago)
- Location:
- branches/2.2.9/mondo/src/mondoarchive
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/mondoarchive/Makefile.am
r1930 r2211 11 11 sbin_PROGRAMS = mondoarchive 12 12 mondoarchive_SOURCES = mondoarchive.c 13 mondoarchive_LDADD = ${top_builddir}/src/common/libmondo.a 13 mondoarchive_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a -
branches/2.2.9/mondo/src/mondoarchive/mondoarchive.c
r2113 r2211 1 1 /*************************************************************************** 2 main.c - description 3 ------------------- 4 begin : Fri Apr 19 16:40:35 EDT 2002 5 copyright : (C) 2002 by Stan Benoit 6 email : troff@nakedsoul.org 7 cvsid : $Id$ 8 ***************************************************************************/ 9 10 /*************************************************************************** 11 * * 12 * This program is free software; you can redistribute it and/or modify * 13 * it under the terms of the GNU General Public License as published by * 14 * the Free Software Foundation; either version 2 of the License, or * 15 * (at your option) any later version. * 16 * * 17 ***************************************************************************/ 18 19 /** 20 * @file 21 * The main file for mondoarchive. 22 */ 2 $Id$ 3 * The main file for mondoarchive. 4 */ 23 5 24 6 /************************* #include statements *************************/ … … 27 9 #include <stdlib.h> 28 10 #include "my-stuff.h" 11 #include "mr_mem.h" 29 12 #include "../common/mondostructures.h" 30 13 #include "../common/libmondo.h" … … 70 53 /* Reference to global bkpinfo */ 71 54 struct s_bkpinfo *bkpinfo; 55 56 /* No cleanup for the moment */ 57 void (*mr_cleanup)(void) = NULL; 72 58 73 59 /* To be coded */ … … 183 169 char *tmp1 = NULL; 184 170 int res, retval; 185 char *say_at_end ;171 char *say_at_end = NULL; 186 172 187 173 /* Make sure I'm root; abort if not */ … … 211 197 diffs = 0; 212 198 malloc_string(tmp); 213 malloc_string(say_at_end);214 say_at_end[0] = '\0';215 199 malloc_libmondo_global_strings(); 216 200 … … 220 204 221 205 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ 222 asprintf(&tmp1,"%s:/sbin:/usr/sbin:/usr/local/sbin",getenv("PATH"));206 mr_asprintf(&tmp1,"%s:/sbin:/usr/sbin:/usr/local/sbin",getenv("PATH")); 223 207 setenv("PATH", tmp1, 1); 224 208 paranoid_free(tmp1); 225 209 226 210 /* Add the ARCH environment variable for ia64 purposes */ 227 asprintf(&tmp1,"%s",get_architecture());211 mr_asprintf(&tmp1,"%s",get_architecture()); 228 212 setenv("ARCH", tmp1, 1); 229 213 paranoid_free(tmp1); … … 378 362 retval += res; 379 363 if (res) { 380 strcat(say_at_end,364 mr_asprintf(&say_at_end, 381 365 "Data archived. Please check the logs, just as a precaution. "); 382 366 } else { 383 strcat(say_at_end, "Data archived OK. ");367 mr_asprintf(&say_at_end, "Data archived OK. "); 384 368 } 385 369 } … … 391 375 sprintf(tmp, "%d difference%c found.", -res, 392 376 (-res != 1) ? 's' : ' '); 393 strcat(say_at_end, tmp);377 mr_asprintf(&say_at_end, tmp); 394 378 log_to_screen(tmp); 395 379 res = 0; … … 424 408 unlink(MONDO_CACHE"/changed.files"); 425 409 } 426 log_to_screen(say_at_end); 410 if (say_at_end != NULL) { 411 log_to_screen(say_at_end); 412 paranoid_free(say_at_end); 413 } 427 414 sprintf(tmp, "umount %s/tmpfs", bkpinfo->tmpdir); 428 415 run_program_and_log_output(tmp, TRUE); … … 445 432 446 433 free_libmondo_global_strings(); 447 paranoid_free(say_at_end);448 434 449 435
Note:
See TracChangeset
for help on using the changeset viewer.