source: MondoRescue/branches/3.3/mondo/test/test-truncname.c

Last change on this file was 3879, checked in by Bruno Cornec, 2 months ago

Fix all remaining compiler errors

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/*
2 * $Id$
3 *
4 * Test program for mountlist management at restore time
5 * Cn be used on host system with valgrind easier than with mondorestore
6 */
7#include <stdio.h>
8#include "my-stuff.h"
9#include "mr_mem.h"
10#include "mondostructures.h"
11#include "mondoarchive.h"
12#include "libmondo-tools-EXT.h"
13#include "newt-specific-EXT.h"
14
15extern void twenty_seconds_til_yikes(void);
16
17extern bool g_text_mode;
18extern FILE *g_fprep;
19extern double g_kernel_version;
20extern int g_partition_table_locked_up;
21extern int g_noof_rows;
22
23/* Whether we should fail immediately at first error */
24bool g_fail_immediately = FALSE;
25
26bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
27bool g_I_have_just_nuked = FALSE;
28char *g_biggielist_txt;
29char *g_filelist_full;
30char *g_filelist_imagedevs;
31char *g_imagedevs_restthese;
32
33char *g_mondo_cfg_file;
34
35char *g_mountlist_fname;
36char *g_mondo_home = NULL;
37
38char *g_getfacl;
39char *g_getfattr;
40
41/* Reference to global bkpinfo */
42struct s_bkpinfo *bkpinfo;
43
44extern char *MONDO_LOGFILE;
45extern char *truncate_to_drive_name(const char *);
46/* We don't have a cleanup function yet */
47void (*mr_cleanup)(void) = NULL;
48void free_MR_global_filenames() {
49}
50
51int main() {
52
53char *part = NULL;
54char *disk = NULL;
55char *list[] = {
56 "/dev/sda99",
57 "/dev/hda12",
58 "/dev/cciss/c12d9p24",
59 "/dev/mapper/vg00lv02",
60 "/dev/mapper/dm-4",
61 "/dev/mapper/mpath4p19",
62 "/dev/mapper/part13",
63 "/dev/rd/c10d4p16",
64 "/dev/cciss/c1d12",
65 "/dev/mapper/mpath34",
66 NULL
67};
68int i;
69
70mr_asprintf(MONDO_LOGFILE,"/tmp/mrtest-truncname.log");
71
72/* Globals */
73g_loglevel = 99;
74g_text_mode = FALSE;
75g_main_pid = getpid();
76
77log_it("Begin loop");
78for (i=0; list[i] != NULL; i++) {
79 log_it("%d: partition %s ...",i, list[i]);
80 mr_asprintf(part,"%s",list[i]);
81 disk = truncate_to_drive_name(part);
82 log_it("...belongs to disk %s",disk);
83 mr_free(part);
84}
85log_it("end of loop");
86mr_free(MONDO_LOGFILE);
87exit(0);
88}
Note: See TracBrowser for help on using the repository browser.