From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Tue, 19 Apr 2016 08:53:48 +0200 (CEST) Date: Tue, 19 Apr 2016 02:53:44 -0400 From: Mike Frysinger Message-ID: <20160419065344.GE5369@vapier.lan> References: <1461046565-16999-1-git-send-email-vapier@gentoo.org> <5715D177.5000701@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lpbaaqEfWJan1gxl" Content-Disposition: inline In-Reply-To: <5715D177.5000701@gmail.com> Subject: Re: [dm-crypt] [PATCH] include sys/sysmacros.h for major/minor/makedev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Milan Broz Cc: dm-crypt@saout.de --lpbaaqEfWJan1gxl Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 19 Apr 2016 08:34, Milan Broz wrote: > On 04/19/2016 08:16 AM, Mike Frysinger wrote: > > These functions are defined in that header, so include it when needed. > > Otherwise we can get build failures like: > > veritysetup-utils_loop.o: In function '_sysfs_backing_file': > > utils_loop.c:(.text+0x50): undefined reference to 'minor' > > utils_loop.c:(.text+0x5e): undefined reference to 'major' > > veritysetup-utils_loop.o: In function 'crypt_loop_device': > > utils_loop.c:(.text+0x638): undefined reference to 'major' > > ../lib/.libs/libcryptsetup.so: undefined reference to 'makedev' > > --- > > lib/utils_devpath.c | 1 + > > lib/utils_loop.c | 1 + > > lib/utils_wipe.c | 1 + > > 3 files changed, 3 insertions(+) > >=20 > > diff --git a/lib/utils_devpath.c b/lib/utils_devpath.c > > index 963785a..0bc0563 100644 > > --- a/lib/utils_devpath.c > > +++ b/lib/utils_devpath.c > > @@ -30,6 +30,7 @@ > > #include > > #include > > #include > > +#include >=20 > Shouldn't we also check for existence of this header in autoconf? > I do not think it is present on all systems (FreeBSD?). i couldn't tell how portable this code base was trying to be or if it was assuming Linux. if you want to be portable w/autoconf, should be easy to do: (1) call AC_HEADER_MAJOR in configure.ac (2) use the idiom: #ifdef MAJOR_IN_MKDEV # include #elif defined(MAJOR_IN_SYSMACROS) # include #endif -mike --lpbaaqEfWJan1gxl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXFdX3AAoJEEFjO5/oN/WBjukP/iwyO0ARO3j/6FEM0uOALAY5 FzNteZ5JSz/GNLkAMvRRxzz55xmqYr7MiYoTyiDsXs1dMltextRIKP9B+Kdw9qhY AlK8Zz1QTuCHUhGYDC1NQ82S+fESwxdIqxR7HKG7Lq8d5m8aJbXpRSdBD9z2nbHc DjWu3rW+zCFTbnQi1AgtBzzhiAlM6TWek/vJKEth3VwlXI8fsdBoDs5h/wUTKZBe vlyYYfWoT+NwDIs1HMv1SIwhXKRz/iR43ZIfV6ugGeyRa8dStQ0f50L5Ue4TPIwL N5tHTK4y8GITYlBGZ7UPCwagnLRlYshMellz1ttFg1pgAhCrHYTger0vtzLiW6MZ uK7uYrz6kc2wJJxPu4G1nc2wegda+3W28Fub5b1nWLaIIuXem78C7E+sQC55l70D BmZA2DYSYr7I9AI0K2hhSI2m42xQLWn4vqilzjYnRHPC0+w7Yc+oRtTrczNjMtuX nmtFKLQUqCDbf8+L62PiT1orD0EdGWLiql8X20fmfXn2ATbRVHVl5wy37b3Ak1sl 1Wt+z+QPQxSO6oxFWSYt5c7vgPE2JpeUeUJtie+sEZnp8j1AJTtNbEsHwD9bm+de cCOHiRPSdKwKUw3iHYj8OByAMdhvEuYtcBLsM67RD3SCDkjDS77gTG+pyoPnqxRj lB5NUhFdrSj/NyXPO1GF =Mmtq -----END PGP SIGNATURE----- --lpbaaqEfWJan1gxl--