Changeset 2383 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-tools.c
- Timestamp:
- Sep 10, 2009, 2:55:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2382 r2383 225 225 d = 5.2; // :-) 226 226 #else 227 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("uname -r"));227 tmp = call_program_and_get_last_line_of_output("uname -r"); 228 228 p = strchr(tmp, '.'); 229 229 if (p) { … … 523 523 if (getenv ("SUDO_COMMAND")) { 524 524 mr_asprintf(command, "strings `which growisofs` | grep -c SUDO_COMMAND"); 525 if (!strcmp(call_program_and_get_last_line_of_output(command), "1")) { 525 tmp = call_program_and_get_last_line_of_output(command); 526 if (!strcmp(tmp, "1")) { 526 527 mr_free(command); 528 mr_free(tmp); 527 529 popup_and_OK("Fatal Error: Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details."); 528 530 fatal_error("Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details."); 529 531 } 530 532 mr_free(command); 533 mr_free(tmp); 531 534 } 532 535 log_msg(2, "call_make_iso (DVD res) is ... %s", bkpinfo->call_make_iso); … … 613 616 mr_asprintf(command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir); 614 617 log_it("command = %s", command); 615 log_it("res of it = %s", call_program_and_get_last_line_of_output(command));616 mr_asprintf(iso_dev, "%s", call_program_and_get_last_line_of_output(command));618 iso_dev = call_program_and_get_last_line_of_output(command); 619 log_it("res of it = %s", iso_dev); 617 620 mr_asprintf(tmp, "%s/ISO-DEV", bkpinfo->tmpdir); 618 write_one_liner_data_file(tmp, call_program_and_get_last_line_of_output(command));621 write_one_liner_data_file(tmp, iso_dev); 619 622 mr_free(tmp); 620 623 mr_free(command); … … 624 627 625 628 log_it("command = %s", command); 626 log_it("res of it = %s", call_program_and_get_last_line_of_output(command));627 mr_asprintf(iso_mnt, "%s", call_program_and_get_last_line_of_output(command));629 iso_mnt = call_program_and_get_last_line_of_output(command); 630 log_it("res of it = %s", iso_mnt); 628 631 mr_asprintf(tmp, "%s/ISO-MNT", bkpinfo->tmpdir); 629 write_one_liner_data_file(tmp, call_program_and_get_last_line_of_output(command));632 write_one_liner_data_file(tmp, iso_mnt); 630 633 mr_free(tmp); 631 634 mr_free(command); … … 899 902 900 903 mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4", partition); 901 mr_asprintf(out_sz, "%s", call_program_and_get_last_line_of_output(command));904 out_sz = call_program_and_get_last_line_of_output(command); 902 905 mr_free(command); 903 906 … … 941 944 run_program_and_log_output("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE); 942 945 } 943 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"));946 tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"); 944 947 if (atol(tmp) < 35000) { 945 948 retval++; … … 1014 1017 1015 1018 run_program_and_log_output("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 1016 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\""));1019 tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\""); 1017 1020 if (strcmp("", tmp)) { 1018 1021 if (strstr(tmp, "autofs")) { … … 1104 1107 } else { 1105 1108 mr_asprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file); 1106 mr_asprintf(value, "%s", call_program_and_get_last_line_of_output(command));1109 value = call_program_and_get_last_line_of_output(command); 1107 1110 mr_free(command); 1108 1111 … … 1232 1235 mr_asprintf(command, "%s", "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1233 1236 log_msg(4, "Cool. Command = '%s'", command); 1234 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));1237 tmp = call_program_and_get_last_line_of_output(command); 1235 1238 mr_free(command); 1236 1239 … … 1239 1242 mr_asprintf(command, "mount | grep -Ew '/boot'"); 1240 1243 mr_free(tmp); 1241 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));1244 tmp = call_program_and_get_last_line_of_output(command); 1242 1245 mr_free(command); 1243 1246 … … 1439 1442 * The command used to start it is saved in @p g_magicdev_command. 1440 1443 */ 1441 void stop_magicdev_if_necessary() 1442 { 1443 strcpy(g_magicdev_command, 1444 call_program_and_get_last_line_of_output 1445 ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99")); 1444 void stop_magicdev_if_necessary() { 1445 1446 char *tmp = NULL; 1447 1448 tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99"); 1449 1450 strcpy(g_magicdev_command, tmp); 1451 mr_free(tmp); 1452 1446 1453 if (g_magicdev_command[0]) { 1447 1454 log_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
Note:
See TracChangeset
for help on using the changeset viewer.