Changeset 3042 in MondoRescue
- Timestamp:
- Oct 7, 2012, 8:44:28 PM (12 years ago)
- Location:
- branches/3.0/mondo
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/libmondo-fork.c
r3037 r3042 261 261 /*@ int ********************************************************* */ 262 262 int res; 263 int i;264 int len;265 263 bool log_if_failure = FALSE; 266 264 bool log_if_success = FALSE; … … 285 283 log_if_failure = TRUE; 286 284 } 287 mr_asprintf( callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir);285 mr_asprintf(&callstr, "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err", program, bkpinfo->tmpdir, bkpinfo->tmpdir); 288 286 while ((p = strchr(callstr, '\r'))) { 289 287 *p = ' '; … … 294 292 295 293 296 len = (int) strlen(program);297 for (i = 0; i < 35 - len / 2; i++) {298 tmp[i] = '-';299 }300 tmp[i] = '\0';301 strcat(tmp, " ");302 strcat(tmp, program);303 strcat(tmp, " ");304 for (i = 0; i < 35 - len / 2; i++) {305 strcat(tmp, "-");306 }307 strcpy(initial_label, tmp);308 294 res = system(callstr); 309 295 if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) { … … 313 299 mr_free(callstr); 314 300 315 mr_asprintf( callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);301 mr_asprintf(&callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir); 316 302 if (log_if_failure && system(callstr)) { 317 303 log_OS_error("Command failed"); … … 319 305 mr_free(callstr); 320 306 321 mr_asprintf( tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir);307 mr_asprintf(&tmp1, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir); 322 308 unlink(tmp1); 323 309 mr_free(tmp1); 324 310 325 mr_asprintf( tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir);311 mr_asprintf(&tmp1, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir); 326 312 fin = fopen(tmp1, "r"); 327 313 if (fin) { -
branches/3.0/mondo/src/common/libmondo-string-EXT.h
r2355 r3042 25 25 extern void strip_spaces(char *in_out); 26 26 extern char *trim_empty_quotes(char *incoming); 27 extern char *truncate_to_drive_name(c har *partition);27 extern char *truncate_to_drive_name(const char *partition); 28 28 extern char *turn_raid_level_number_to_string(int raid_level); 29 29 -
branches/3.0/mondo/src/common/libmondo-string.c
r2980 r3042 811 811 * @return @p partition. 812 812 */ 813 char *truncate_to_drive_name(c har *partition)813 char *truncate_to_drive_name(const char *partition) 814 814 { 815 815 int i = strlen(partition) - 1; -
branches/3.0/mondo/src/common/libmondo-string.h
r2355 r3042 21 21 void strip_spaces(char *in_out); 22 22 char *trim_empty_quotes(char *incoming); 23 char *truncate_to_drive_name(c har *partition);23 char *truncate_to_drive_name(const char *partition); 24 24 char *turn_raid_level_number_to_string(int raid_level); 25 25 void printf_silly_message(void); -
branches/3.0/mondo/src/common/libmondo-tools.c
r2982 r3042 647 647 colon++; 648 648 hent = gethostbyname(colon); 649 mr_asprintf( bkpinfo->netfs_user,"%s", hostname);649 mr_asprintf(&(bkpinfo->netfs_user),"%s", hostname); 650 650 } else { 651 651 hent = gethostbyname(hostname); -
branches/3.0/mondo/src/mondorestore/mondoprep.h
r684 r3042 82 82 83 83 84 char *truncate_to_drive_name(c har *partition);84 char *truncate_to_drive_name(const char *partition); 85 85 void create_mountlist_for_drive(struct mountlist_itself *mountlist, 86 86 char *drive_name, -
branches/3.0/mondo/test/test-truncname.c
r2236 r3042 41 41 42 42 extern char *MONDO_LOGFILE; 43 extern char *truncate_to_drive_name(c har *);43 extern char *truncate_to_drive_name(const char *); 44 44 /* We don't have a cleanup function yet */ 45 45 void (*mr_cleanup)(void) = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.