Changeset 1653 in MondoRescue for branches/2.2.5/mondo/src/common/libmondo-tools.c
- Timestamp:
- Sep 24, 2007, 2:01:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-tools.c
r1652 r1653 182 182 #include <sys/socket.h> 183 183 #include <netdb.h> 184 #include <stdlib.h> 184 185 #include <netinet/in.h> 185 186 #include <arpa/inet.h> … … 944 945 945 946 unlink(MONDO_TRACEFILE); 946 asprintf(&tmp,"rm -Rf %s/changed.files*", bkpinfo->tmpdir);947 asprintf(&tmp,"rm -Rf %s/changed.files*",MINDI_CACHE); 947 948 run_program_and_log_output(tmp, FALSE); 948 949 paranoid_free(tmp); … … 962 963 } 963 964 964 965 void setup_tmpdir() { 966 967 char *tmp = NULL; 968 969 if (getenv("TMPDIR")) { 970 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMPDIR")); 971 } else if (getenv("TMP")) { 972 asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMP")); 973 } else { 974 asprintf(&tmp, "/tmp/mondo.tmp.XXXXXX"); 975 } 976 if ((bkpinfo->tmpdir = mkdtemp(bkpinfo->tmpdir)) == NULL) { 977 log_it("Failed to create global tmp directory %s for Mondo.",bkpinfo->tmpdir); 978 finish(-1); 979 } 980 //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768)); // for mondorestore 981 } 965 982 966 983 … … 976 993 assert(bkpinfo != NULL); 977 994 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo)); 995 996 /* special case for tmpdir as used eveywhere after */ 997 setup_tmpdir(); 998 978 999 bkpinfo->manual_cd_tray = FALSE; 979 1000 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; … … 1004 1025 bkpinfo->scratchdir[0] = '\0'; 1005 1026 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 1006 sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768)); // for mondorestore1007 1027 bkpinfo->optimal_set_size = 0; 1008 1028 bkpinfo->backup_media_type = none;
Note:
See TracChangeset
for help on using the changeset viewer.