Date: Wed, 18 Nov 2015 06:28:39 +0000 (UTC) From: Alexey Dokuchaev <danfe@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r401846 - in head/sysutils/linuxfdisk: . files Message-ID: <201511180628.tAI6SdeY081874@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: danfe Date: Wed Nov 18 06:28:39 2015 New Revision: 401846 URL: https://svnweb.freebsd.org/changeset/ports/401846 Log: 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. Modified: head/sysutils/linuxfdisk/Makefile head/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c Modified: head/sysutils/linuxfdisk/Makefile ============================================================================== --- head/sysutils/linuxfdisk/Makefile Wed Nov 18 06:22:31 2015 (r401845) +++ head/sysutils/linuxfdisk/Makefile Wed Nov 18 06:28:39 2015 (r401846) @@ -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> Modified: head/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c ============================================================================== --- head/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c Wed Nov 18 06:22:31 2015 (r401845) +++ head/sysutils/linuxfdisk/files/linuxfdisk-sys_bsd.c Wed Nov 18 06:28:39 2015 (r401846) @@ -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 } } #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_ge { /* 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511180628.tAI6SdeY081874>