Revision 57e69b7d

b/block/raw-posix.c
993 993

  
994 994
    fd = open(filename, O_WRONLY | O_BINARY);
995 995
    if (fd < 0)
996
        return -EIO;
996
        return -errno;
997 997

  
998 998
    if (fstat(fd, &stat_buf) < 0)
999
        ret = -EIO;
999
        ret = -errno;
1000 1000
    else if (!S_ISBLK(stat_buf.st_mode) && !S_ISCHR(stat_buf.st_mode))
1001
        ret = -EIO;
1001
        ret = -ENODEV;
1002 1002
    else if (lseek(fd, 0, SEEK_END) < total_size * 512)
1003 1003
        ret = -ENOSPC;
1004 1004

  

Also available in: Unified diff