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


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/common
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-archive.c

    r2357 r2376  
    17221722                    ("Failed to write to disk. I shall blank it and then try again.");
    17231723                sleep(5);
    1724                 (void)system("sync");
     1724                sync();
    17251725                pause_for_N_seconds(5, "Letting DVD drive settle");
    17261726
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2375 r2376  
    13501350
    13511351        while (what_number_cd_is_this() != cd_number_i_want) {
    1352             paranoid_system("sync");
     1352            sync();
    13531353            if (is_this_device_mounted(MNT_CDROM)) {
    13541354                res =
     
    13721372                inject_device(bkpinfo->media_device);
    13731373            }
    1374             paranoid_system("sync");
     1374            sync();
    13751375        }
    13761376        mr_free(request);
  • branches/2.2.10/mondo/src/common/libmondo-fifo.c

    r2332 r2376  
    8585    wise_upper_limit = (am_I_in_disaster_recovery_mode()? 8 : 32);
    8686    wise_lower_limit = 1;       // wise_upper_limit/2 + 1;
    87     paranoid_system("sync");
     87    sync();
    8888    for (bufsize = wise_upper_limit, res = -1;
    8989         res != 0 && bufsize >= wise_lower_limit; bufsize--) {
     
    162162        return;
    163163    }
    164     paranoid_system("sync");
     164    sync();
    165165    mr_asprintf(command, "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    166166    log_msg(2, "kill_buffer() --- command = %s", command);
  • branches/2.2.10/mondo/src/common/libmondo-stream.c

    r2334 r2376  
    134134    }
    135135    sleep(1);
    136     paranoid_system("sync");
     136    sync();
    137137    sleep(1);
    138138    paranoid_pclose(g_tape_stream);
     
    173173
    174174    sleep(1);
    175     paranoid_system("sync");
     175    sync();
    176176    sleep(1);
    177177    log_it("closeout_tape() -- entering");
     
    14671467
    14681468    paranoid_pclose(g_tape_stream);
    1469     system("sync");
    1470     system("sync");
    1471     system("sync");
     1469    sync();
     1470    sync();
     1471    sync();
    14721472    log_it("New tape requested.");
    14731473    insist_on_this_tape_number(g_current_media_number + 1); // will increment g_current_media, too
  • branches/2.2.10/mondo/src/common/libmondo-verify.c

    r2357 r2376  
    9292
    9393    mr_asprintf(afio_found_changes, "%s.afio", ignorefiles_fname);
    94     paranoid_system("sync");
     94    sync();
    9595
    9696    log_msg(1, "Now scanning log file for 'afio: ' stuff");
     
    11771177    retval += verify_biggiefiles_from_stream();
    11781178/* find the final blocks */
    1179     paranoid_system("sync");
     1179    sync();
    11801180    sleep(2);
    11811181    closein_tape();
  • branches/2.2.10/mondo/src/common/newt-specific.c

    r2357 r2376  
    9999    long g_start_time = 0L;     ///< The time (in seconds since the epoch) that the progress form was opened.
    100100    bool g_text_mode = TRUE;    ///< If FALSE, use a newt interface; if TRUE, use an ugly (but more compatible) dumb terminal interface.
    101     char g_xmondo_stdin[MAX_NEWT_COMMENT_LEN],  ///< ... @bug Unneeded w/current XMondo.
    102      g_xmondo_stdout[MAX_NEWT_COMMENT_LEN]; ///< .... @bug Unneeded w/current XMondo.
    103     bool g_called_by_xmondo = FALSE;    ///< @bug Unneeded w/current XMondo.
    104101    char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.
    105102
    106103/* @} - end of globalGroup */
    107 
    108 //int g_fd_in=-1, g_fd_out=-1;
    109104
    110105    void popup_and_OK(char *);
     
    130125        if (g_text_mode) {
    131126            while (1) {
    132                 system("sync");
     127                sync();
    133128                printf("---promptdialogYN---1--- %s\n---promptdialogYN---Q--- [yes] [no] ---\n--> ", prompt);
    134129                mr_getline(tmp, stdin);
     
    147142                    return (FALSE);
    148143                } else {
    149                     system("sync");
     144                    sync();
    150145                    printf("Please enter either YES or NO (or yes or no, or y or n, or...)\n");
    151146                }
     
    172167
    173168        if (g_text_mode) {
    174             system("sync");
     169            sync();
    175170            printf("---promptdialogOKC---1--- %s\n---promptdialogOKC---Q--- [OK] [Cancel] ---\n--> ", prompt);
    176171            mr_getline(tmp, stdin);
Note: See TracChangeset for help on using the changeset viewer.