From eb7d2f90f8aa55bdb07288a750a8748887735c33 Mon Sep 17 00:00:00 2001 From: yoe Date: Fri, 23 Apr 2004 18:41:38 +0000 Subject: [PATCH] r56: check for BLKGETSIZE anyway, because it might not exist (and does not, on FreeBSD) --- nbd-server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 1.7.10.4