Changeset 2376 in MondoRescue for branches/2.2.10/mondo/src/mondorestore


Ignore:
Timestamp:
Sep 9, 2009, 12:37:59 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • replace system("sync") by sync() calls
Location:
branches/2.2.10/mondo/src/mondorestore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2357 r2376  
    118118                }
    119119            }
    120             system("sync");
    121             system("sync");
    122             system("sync");
     120            sync();
     121            sync();
     122            sync();
    123123            popup_and_OK
    124124                ("I must now reboot. Please leave the boot media in the drive and repeat your actions - e.g. type 'nuke' - and it should work fine.");
     
    277277        if (res && strstr(command, "create") && vacuum_pack) {
    278278            sleep(2);
    279             system("sync");
    280             system("sync");
    281             system("sync");
     279            sync();
     280            sync();
     281            sync();
    282282        }
    283283        if ((p = strstr(incoming, "vgcreate"))) {
     
    408408    }
    409409    paranoid_free(command);
    410     system("sync");
    411     system("sync");
    412     system("sync");
     410    sync();
     411    sync();
     412    sync();
    413413    sleep(1);
    414414    log_it("ENDING");
     
    764764        log_to_screen("Stopping %s", device);
    765765        stop_raid_device(device);
    766         system("sync");
     766        sync();
    767767        sleep(1);
    768768
     
    776776            res = run_program_and_log_output(program, 1);
    777777            log_msg(1, "%s returned %d", program, res);
    778             system("sync");
     778            sync();
    779779            sleep(3);
    780780            start_raid_device(device);
     
    784784            mr_free(program);
    785785        }
    786         system("sync");
     786        sync();
    787787        sleep(2);
    788788#endif
    789         system("sync");
     789        sync();
    790790        sleep(1);
    791791        newtResume();
     
    849849    mr_free(program);
    850850    retval += res;
    851     system("sync");
     851    sync();
    852852    sleep(1);
    853853    return (retval);
     
    901901    log_msg(1, "Stopping all RAID devices");
    902902    stop_all_raid_devices(mountlist);
    903     system("sync");
    904     system("sync");
    905     system("sync");
     903    sync();
     904    sync();
     905    sync();
    906906    sleep(2);
    907907    log_msg(1, "Prepare soft-RAIDs");   // prep and format too
     
    925925        }
    926926    }
    927     system("sync");
    928     system("sync");
    929     system("sync");
     927    sync();
     928    sync();
     929    sync();
    930930    sleep(2);
    931931// This last step is probably necessary
     
    10281028                ("Please choose 'yes' to reboot and try again; or 'no' to ignore this warning and continue."))
    10291029            {
    1030                 system("sync");
    1031                 system("sync");
    1032                 system("sync");
     1030                sync();
     1031                sync();
     1032                sync();
    10331033                system("reboot");
    10341034            }
     
    15211521                }
    15221522            }
    1523             system("sync");
     1523            sync();
    15241524#else
    15251525            log_it("New, kernel-friendly partition remover");
     
    15841584        // close fdisk
    15851585        fput_string_one_char_at_a_time(pout_to_fdisk, "w\n");
    1586         system("sync");
     1586        sync();
    15871587        paranoid_pclose(pout_to_fdisk);
    15881588        log_msg(0,
     
    22152215        log_msg(1, "Warning - unable to stop some RAID devices");
    22162216    }
    2217     system("sync");
    2218     system("sync");
    2219     system("sync");
     2217    sync();
     2218    sync();
     2219    sync();
    22202220    sleep(1);
    22212221    return (retval);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2357 r2376  
    624624            log_msg(2, "Failed to mount device.");
    625625            sleep(5);
    626             run_program_and_log_output("sync", FALSE);
     626            sync();
    627627        }
    628628    }
     
    13711371    name = read_cfg_var(g_mondo_cfg_file, "bootloader.name");
    13721372    log_msg(2, "run_boot_loader: device='%s', name='%s'", device, name);
    1373     system("sync");
     1373    sync();
    13741374
    13751375    offer_to_make_initrd();
     
    20262026    }
    20272027
    2028     paranoid_system("sync");
     2028    sync();
    20292029
    20302030    mr_asprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE);
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2352 r2376  
    811811                log_to_screen("Preparing to format your disk(s)");
    812812                sleep(1);
    813                 system("sync");
     813                sync();
    814814                log_to_screen("Please wait. This may take a few minutes.");
    815815                res += format_everything(mountlist, FALSE, raidlist);
     
    29252925                                "Run complete. Please remove media and reboot.");
    29262926        } else {
    2927             run_program_and_log_output("sync", FALSE);
     2927            sync();
    29282928            if (is_this_device_mounted(MNT_CDROM)) {
    29292929                run_program_and_log_output("umount " MNT_CDROM, FALSE);
Note: See TracChangeset for help on using the changeset viewer.