bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] mknod: mknod() needs unistd.h on OS/2 kLIBC


From: Eric Blake
Subject: Re: [PATCH 2/2] mknod: mknod() needs unistd.h on OS/2 kLIBC
Date: Thu, 17 Jan 2019 07:45:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/16/19 10:35 PM, KO Myung-Hun wrote:
> On OS/2 kLIBC, mknod() is declared in unistd.h. This fixes 'implicit
> declaration of function' compilation warning.
> 
> * lib/mknod.c: Include unistd.h.
> ---
>  lib/mknod.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/mknod.c b/lib/mknod.c
> index dbbfe29c4..1d4b490ca 100644
> --- a/lib/mknod.c
> +++ b/lib/mknod.c
> @@ -18,6 +18,8 @@
>  
>  #include <config.h>
>  
> +/* On OS/2 kLIBC, mknod() is declared in unistd.h.  */
> +#include <unistd.h>
>  #include <sys/stat.h>

This patch is wrong; it only fixes the symptom instead of the problem,
and anyone using the module would have to repeat the fix in their own .c
files. Instead, we should be fixing the gnulib <sys/stat.h> replacement
header to pull in <unistd.h> automatically on OS/2, so that anyone using
the gnulib module can use just the POSIX header to get the declaration.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]