Ignore:
Timestamp:
Sep 9, 2009, 12:37:59 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • replace system("sync") by sync() calls
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.