From: yoe Date: Fri, 23 Apr 2004 18:41:38 +0000 (+0000) Subject: r56: check for BLKGETSIZE anyway, because it might not exist (and does not, X-Git-Url: http://git.alex.org.uk r56: check for BLKGETSIZE anyway, because it might not exist (and does not, on FreeBSD) --- diff --git a/nbd-server.c b/nbd-server.c index 212ed9f..6891a1a 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -409,13 +409,15 @@ off_t size_autodetect(int export) #ifdef HAVE_SYS_MOUNT_H #ifdef HAVE_SYS_IOCTL_H +#ifdef BLKGETSIZE DEBUG("looking for export size with ioctl BLKGETSIZE\n"); if (!ioctl(export, BLKGETSIZE, &es32) && es32) { es = (off_t)es32 * (off_t)512; return es; } -#endif -#endif +#endif /* BLKGETSIZE */ +#endif /* HAVE_SYS_IOCTL_H */ +#endif /* HAVE_SYS_MOUNT_H */ DEBUG("looking for export size with fstat\n"); stat_buf.st_size = 0;