aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2015-11-18 14:28:39 +0800
committerdanfe <danfe@FreeBSD.org>2015-11-18 14:28:39 +0800
commitd8af691f05a6c54bd718f211a762e419b587b080 (patch)
tree1e85507557eed8bfbf91691c171530f928cd57c8
parent0fac9a2aa5515910562159de0b56b45e2a865675 (diff)
downloadfreebsd-ports-gnome-d8af691f05a6c54bd718f211a762e419b587b080.tar.gz
freebsd-ports-gnome-d8af691f05a6c54bd718f211a762e419b587b080.tar.zst
freebsd-ports-gnome-d8af691f05a6c54bd718f211a762e419b587b080.zip
Unbreak `sysutils/linuxfdisk' after r276737, which removed DIOCGDINFO once
and for all; the code in `sys_bsd.c' is already using working alternatives DIOCGMEDIASIZE and DIOCGSECTORSIZE except in sys_bsd_getgeometry(), but it returns -1 for me even on stable/8. While here, clean up Makefile a bit.
-rw-r--r--sysutils/linuxfdisk/Makefile7
-rw-r--r--sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/sysutils/linuxfdisk/Makefile b/sysutils/linuxfdisk/Makefile
index b82f5468f2d6..299a867eb1af 100644
--- a/sysutils/linuxfdisk/Makefile
+++ b/sysutils/linuxfdisk/Makefile
@@ -4,7 +4,7 @@
PORTNAME= linuxfdisk
PORTVERSION= 2.11z
CATEGORIES= sysutils
-MASTER_SITES= http://ftp.sunet.se/pub/Linux/kernel.org/linux/utils/util-linux/v2.11/ \
+MASTER_SITES= KERNEL_ORG/linux/utils/util-linux/v2.11/ \
http://ftp.be.debian.org/pub/linux/utils/util-linux/v2.11/ \
ftp://segfault.kiev.ua/pub/
DISTNAME= util-linux-${PORTVERSION}
@@ -17,8 +17,7 @@ USES= tar:bzip2
ONLY_FOR_ARCHS= i386 amd64
pre-patch:
- @rm -f ${WRKSRC}/Makefile
- @cp ${FILESDIR}/linuxfdisk-Makefile ${WRKSRC}/Makefile
- @cp ${FILESDIR}/linuxfdisk-sys_bsd.c ${WRKSRC}/sys_bsd.c
+ @${CP} ${FILESDIR}/linuxfdisk-Makefile ${WRKSRC}/Makefile
+ @${CP} ${FILESDIR}/linuxfdisk-sys_bsd.c ${WRKSRC}/sys_bsd.c
.include <bsd.port.mk>
diff --git a/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c b/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c
index fde86bc2bf21..eb3a97ea9226 100644
--- a/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c
+++ b/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c
@@ -20,11 +20,13 @@ sys_bsd_sectorsize(int fd)
return d;
}
#endif
+#ifdef DIOCGDINFO
;{
struct disklabel dl;
if (ioctl(fd, DIOCGDINFO, &dl) == 0)
return dl.d_secsize;
}
+#endif
#ifdef DIOCGSLICEINFO
;{
struct diskslices dss;
@@ -75,11 +77,13 @@ sys_bsd_getsectors(int fd, unsigned long *s)
}
}
#endif
+#ifdef DIOCGDINFO
/* Fallback method. */
if (ioctl(fd, DIOCGDINFO, &dl) == 0) {
*s = (unsigned long) dl.d_secperunit;
return 0;
}
+#endif
return -1;
}
@@ -103,7 +107,9 @@ sys_bsd_getgeometry(int fd, struct hd_geometry *g)
{
/* XXX */
struct disklabel dl;
+#ifdef DIOCGDINFO
if (ioctl(fd, DIOCGDINFO, &dl) < 0)
+#endif
return -1;
g->cylinders = dl.d_ncylinders;
g->heads = dl.d_ntracks;