summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-03-24 15:59:47 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-03-24 15:59:47 +0100
commit75c3c983d4910f937672ad90b6e1de0c49f406bf (patch)
tree010527495319d3f801e91b5903d9899667b33754 /src
parentcb62d65a75fc321cb7e3448fb0a695b867706dd5 (diff)
fsync function may be missing, fix for mingw
Diffstat (limited to 'src')
-rw-r--r--src/hdaccess.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hdaccess.c b/src/hdaccess.c
index e769fa0..ed976df 100644
--- a/src/hdaccess.c
+++ b/src/hdaccess.c
@@ -1535,7 +1535,12 @@ static void disk_get_info(const int hd_h, disk_t *dev, const int verbose)
#endif
#if defined(__CYGWIN__) || defined(__MINGW32__)
{
- HANDLE handle=(HANDLE)get_osfhandle(hd_h);
+ HANDLE handle;
+#if defined(__CYGWIN__)
+ handle=(HANDLE)get_osfhandle(hd_h);
+#else
+ handle=(HANDLE)_get_osfhandle(hd_h);
+#endif
file_win32_disk_get_info(handle, dev, verbose);
}
#endif
@@ -1713,7 +1718,12 @@ static int file_nowrite(disk_t *disk_car,const unsigned int count, const void *b
static int file_sync(disk_t *disk_car)
{
struct info_file_struct *data=disk_car->data;
+#ifdef HAVE_FSYNC
return fsync(data->handle);
+#else
+ errno=EINVAL;
+ return -1;
+#endif
}
static void autoset_geometry(disk_t * disk_car, const unsigned char *buffer, const int verbose)