util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cfdisk: fix missing prototype for `get_wch`
@ 2018-04-10 12:36 Patrick Steinhardt
  2018-04-10 12:36 ` [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h> Patrick Steinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrick Steinhardt @ 2018-04-10 12:36 UTC (permalink / raw)
  To: util-linux; +Cc: Patrick Steinhardt

The header <ncursesw/ncurses.h> defines the get_wch(3) function only
when `NCURSES_WIDECHAR` is defined. This define is actually getting set
in the same header file, but only in case `_XOPEN_SOURCE` is defined and
has a value of 500 or higher. As we already have the precedence of
defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply
define it to the minimum required value of 500 in "cfdisk.c". This
silences a warning for `get_wch` being unknown.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 disk-utils/cfdisk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 806bff837..8f590387f 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -33,6 +33,10 @@
 # include <slang/slang.h>
 #endif
 
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 500 /* for inclusion of get_wch */
+#endif
+
 #ifdef HAVE_SLCURSES_H
 # include <slcurses.h>
 #elif defined(HAVE_SLANG_SLCURSES_H)
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h>
  2018-04-10 12:36 [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Patrick Steinhardt
@ 2018-04-10 12:36 ` Patrick Steinhardt
  2018-04-11 11:07   ` Karel Zak
  2018-04-10 13:11 ` [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Karel Zak
  2018-04-11 11:06 ` Karel Zak
  2 siblings, 1 reply; 5+ messages in thread
From: Patrick Steinhardt @ 2018-04-10 12:36 UTC (permalink / raw)
  To: util-linux; +Cc: Patrick Steinhardt

The POSIX standard states that poll(3P) is being made available by
<poll.h>, not <sys/poll.h>. Most commands already include the correct
header, with the exception of rfkill. Fix that to avoid a warning on
musl-based systems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 sys-utils/rfkill.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index 211316ce7..9c52fac3a 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -24,7 +24,7 @@
 #include <getopt.h>
 #include <libsmartcols.h>
 #include <linux/rfkill.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/syslog.h>
 #include <sys/time.h>
 
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cfdisk: fix missing prototype for `get_wch`
  2018-04-10 12:36 [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Patrick Steinhardt
  2018-04-10 12:36 ` [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h> Patrick Steinhardt
@ 2018-04-10 13:11 ` Karel Zak
  2018-04-11 11:06 ` Karel Zak
  2 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2018-04-10 13:11 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: util-linux

On Tue, Apr 10, 2018 at 01:36:31PM +0100, Patrick Steinhardt wrote:
> The header <ncursesw/ncurses.h> defines the get_wch(3) function only
> when `NCURSES_WIDECHAR` is defined. This define is actually getting set

Oh, ncurses saga continues...  why someone has to define NCURSES_WIDECHAR 
when use ncursesw/ (wide-char!) directory ?

> in the same header file, but only in case `_XOPEN_SOURCE` is defined and
> has a value of 500 or higher. As we already have the precedence of
> defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply
> define it to the minimum required value of 500 in "cfdisk.c". This
> silences a warning for `get_wch` being unknown.

OK, I'll apply the patch. Thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cfdisk: fix missing prototype for `get_wch`
  2018-04-10 12:36 [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Patrick Steinhardt
  2018-04-10 12:36 ` [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h> Patrick Steinhardt
  2018-04-10 13:11 ` [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Karel Zak
@ 2018-04-11 11:06 ` Karel Zak
  2 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2018-04-11 11:06 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: util-linux

On Tue, Apr 10, 2018 at 01:36:31PM +0100, Patrick Steinhardt wrote:
>  disk-utils/cfdisk.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h>
  2018-04-10 12:36 ` [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h> Patrick Steinhardt
@ 2018-04-11 11:07   ` Karel Zak
  0 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2018-04-11 11:07 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: util-linux

On Tue, Apr 10, 2018 at 01:36:32PM +0100, Patrick Steinhardt wrote:
>  sys-utils/rfkill.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
 
 Applied, thanks.


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-11 11:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 12:36 [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Patrick Steinhardt
2018-04-10 12:36 ` [PATCH 2/2] rfkill: include <poll.h> instead of <sys/poll.h> Patrick Steinhardt
2018-04-11 11:07   ` Karel Zak
2018-04-10 13:11 ` [PATCH 1/2] cfdisk: fix missing prototype for `get_wch` Karel Zak
2018-04-11 11:06 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).