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