First Commit
[librecmc/package-feed.git] / utils / gpsd / patches / 0001-Remove-a-BSD-ism.patch
1 From 95c99f69e026e8c57aecba545e51c97f3b284e75 Mon Sep 17 00:00:00 2001
2 From: "Gary E. Miller" <gem@rellim.com>
3 Date: Tue, 23 Jun 2015 14:36:26 -0700
4 Subject: [PATCH] Remove a BSD-ism.
5
6 CTRL('L') is a BSD-ism.  CTRL() is defined in sys/ttydefaults.h
7 which does not always exist.  Instead of adding scons tests for
8 needing CTRL() and its include files just replace with a simple
9 constant.
10
11 Needed for musl and found by Baruch Siach <baruch@tkos.co.il>
12 ---
13  gpsmon.c | 6 +++++-
14  1 file changed, 5 insertions(+), 1 deletion(-)
15
16 diff --git a/gpsmon.c b/gpsmon.c
17 index c3001c8..58c8300 100644
18 --- a/gpsmon.c
19 +++ b/gpsmon.c
20 @@ -583,6 +583,9 @@ static void select_packet_monitor(struct gps_device_t *device)
21         (void)wnoutrefresh(devicewin);
22  }
23  
24 +/* Control-L character */
25 +#define CTRL_L 0x0C
26 +
27  static char *curses_get_command(void)
28  /* char-by-char nonblocking input, return accumulated command line on \n */
29  {
30 @@ -591,7 +594,8 @@ static char *curses_get_command(void)
31      int c;
32  
33      c = wgetch(cmdwin);
34 -    if (c == CTRL('L')) {
35 +    if (CTRL_L == c) {
36 +        /* ^L is to repaint the screen */
37         (void)clearok(stdscr, true);
38         if (active != NULL && (*active)->initialize != NULL)
39             (void)(*active)->initialize();
40 -- 
41 2.6.0
42