Revision c57c846a block/raw-posix.c

b/block/raw-posix.c
97 97
#define FTYPE_CD     1
98 98
#define FTYPE_FD     2
99 99

  
100
/* if the FD is not accessed during that time (in ms), we try to
100
/* if the FD is not accessed during that time (in ns), we try to
101 101
   reopen it to see if the disk has been changed */
102
#define FD_OPEN_TIMEOUT 1000
102
#define FD_OPEN_TIMEOUT (1000000000)
103 103

  
104 104
#define MAX_BLOCKSIZE	4096
105 105

  
......
908 908
        return 0;
909 909
    last_media_present = (s->fd >= 0);
910 910
    if (s->fd >= 0 &&
911
        (qemu_get_clock(rt_clock) - s->fd_open_time) >= FD_OPEN_TIMEOUT) {
911
        (get_clock() - s->fd_open_time) >= FD_OPEN_TIMEOUT) {
912 912
        close(s->fd);
913 913
        s->fd = -1;
914 914
#ifdef DEBUG_FLOPPY
......
917 917
    }
918 918
    if (s->fd < 0) {
919 919
        if (s->fd_got_error &&
920
            (qemu_get_clock(rt_clock) - s->fd_error_time) < FD_OPEN_TIMEOUT) {
920
            (get_clock() - s->fd_error_time) < FD_OPEN_TIMEOUT) {
921 921
#ifdef DEBUG_FLOPPY
922 922
            printf("No floppy (open delayed)\n");
923 923
#endif
......
925 925
        }
926 926
        s->fd = open(bs->filename, s->open_flags & ~O_NONBLOCK);
927 927
        if (s->fd < 0) {
928
            s->fd_error_time = qemu_get_clock(rt_clock);
928
            s->fd_error_time = get_clock();
929 929
            s->fd_got_error = 1;
930 930
            if (last_media_present)
931 931
                s->fd_media_changed = 1;
......
940 940
    }
941 941
    if (!last_media_present)
942 942
        s->fd_media_changed = 1;
943
    s->fd_open_time = qemu_get_clock(rt_clock);
943
    s->fd_open_time = get_clock();
944 944
    s->fd_got_error = 0;
945 945
    return 0;
946 946
}

Also available in: Unified diff