All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] [PATCH] include sys/sysmacros.h for major/minor/makedev
Date: Tue, 19 Apr 2016 08:34:31 +0200	[thread overview]
Message-ID: <5715D177.5000701@gmail.com> (raw)
In-Reply-To: <1461046565-16999-1-git-send-email-vapier@gentoo.org>


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(+)
> 
> 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 <errno.h>
>  #include <limits.h>
>  #include <sys/stat.h>
> +#include <sys/sysmacros.h>

Shouldn't we also check for existence of this header in autoconf?
I do not think it is present on all systems (FreeBSD?).

(Basically the same like util-linux is doing now.)

Milan

>  #include <sys/types.h>
>  #include "internal.h"
>  
> diff --git a/lib/utils_loop.c b/lib/utils_loop.c
> index ff30a27..b392160 100644
> --- a/lib/utils_loop.c
> +++ b/lib/utils_loop.c
> @@ -27,6 +27,7 @@
>  #include <limits.h>
>  #include <sys/ioctl.h>
>  #include <sys/stat.h>
> +#include <sys/sysmacros.h>
>  #include <sys/types.h>
>  #include <linux/loop.h>
>  
> diff --git a/lib/utils_wipe.c b/lib/utils_wipe.c
> index 210c566..8e2a2aa 100644
> --- a/lib/utils_wipe.c
> +++ b/lib/utils_wipe.c
> @@ -29,6 +29,7 @@
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <sys/ioctl.h>
> +#include <sys/sysmacros.h>
>  #include <fcntl.h>
>  
>  #include "libcryptsetup.h"
> 

  reply	other threads:[~2016-04-19  6:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  6:16 [dm-crypt] [PATCH] include sys/sysmacros.h for major/minor/makedev Mike Frysinger
2016-04-19  6:34 ` Milan Broz [this message]
2016-04-19  6:53   ` Mike Frysinger
2016-04-19  9:06     ` Milan Broz
2016-04-19 15:22       ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5715D177.5000701@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.