Changeset 2700 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-fork.c
- Timestamp:
- Jan 27, 2011, 7:31:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-fork.c
r2656 r2700 379 379 380 380 /*@ buffers **************************************************** */ 381 char tmp[MAX_STR_LEN * 2];382 char command[MAX_STR_LEN * 2];381 char *tmp = NULL; 382 char *command = NULL; 383 383 char lockfile[MAX_STR_LEN]; 384 384 … … 389 389 sprintf(lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir); 390 390 391 sprintf(command,391 mr_asprintf(&command, 392 392 "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res", 393 393 lockfile, basic_call, MONDO_LOGFILE, MONDO_LOGFILE, lockfile); 394 394 open_evalcall_form(what_i_am_doing); 395 sprintf(tmp, "Executing %s", basic_call);395 mr_asprintf(&tmp, "Executing %s", basic_call); 396 396 log_msg(2, tmp); 397 mr_free(tmp); 398 397 399 if (!(fin = popen(command, "r"))) { 398 400 log_OS_error("Unable to popen-in command"); 399 sprintf(tmp, "Failed utterly to call '%s'", command);401 mr_asprintf(&tmp, "Failed utterly to call '%s'", command); 400 402 log_to_screen(tmp); 403 mr_free(tmp); 404 mr_free(command); 401 405 return (1); 402 406 } … … 407 411 } 408 412 } 413 mr_free(command); 409 414 #ifdef _XWIN 410 415 /* This only can update when newline goes into the file, … … 412 417 while (does_file_exist(lockfile)) { 413 418 while (!feof(fin)) { 419 /* TODO: Dead and wrong code */ 414 420 if (!fgets(tmp, 512, fin)) 415 421 break;
Note:
See TracChangeset
for help on using the changeset viewer.