1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
| | Mingw lacks some SIG*. Taken from
wget https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-readline/readline-6.3-mingw.patch
some updates to make it apply.
--- colors.c~ 2013-03-20 11:19:08.000000000 -0400
+++ colors.c 2015-07-20 12:44:31.821014500 -0400
@@ -37,6 +37,10 @@
#include "posixstat.h" // stat related macros (S_ISREG, ...)
#include <fcntl.h> // S_ISUID
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
// strlen()
#if defined (HAVE_STRING_H)
# include <string.h>
@@ -151,12 +155,17 @@
if (S_ISREG (mode))
{
colored_filetype = C_FILE;
-
+#ifdef S_ISUID
if ((mode & S_ISUID) != 0 && is_colored (C_SETUID))
colored_filetype = C_SETUID;
- else if ((mode & S_ISGID) != 0 && is_colored (C_SETGID))
+ else
+#endif
+#ifdef S_ISGID
+ if ((mode & S_ISGID) != 0 && is_colored (C_SETGID))
colored_filetype = C_SETGID;
- else if (is_colored (C_CAP) && 0) //f->has_capability)
+ else
+#endif
+ if (is_colored (C_CAP) && 0) //f->has_capability)
colored_filetype = C_CAP;
else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC))
colored_filetype = C_EXEC;
@@ -180,15 +189,19 @@
colored_filetype = C_STICKY;
#endif
}
+ #ifdef S_ISLNK
else if (S_ISLNK (mode))
colored_filetype = ((linkok == 0
&& (!strncmp (_rl_color_indicator[C_LINK].string, "target", 6)
|| _rl_color_indicator[C_ORPHAN].string))
? C_ORPHAN : C_LINK);
+ #endif
else if (S_ISFIFO (mode))
colored_filetype = C_FIFO;
+ #ifdef S_ISSOCK
else if (S_ISSOCK (mode))
colored_filetype = C_SOCK;
+#endif
else if (S_ISBLK (mode))
colored_filetype = C_BLK;
else if (S_ISCHR (mode))
--- signals.c~ 2014-01-10 15:06:48.000000000 -0500
+++ signals.c 2015-07-20 12:33:07.437472100 -0400
@@ -216,7 +216,9 @@
/* FALLTHROUGH */
case SIGTERM:
+#if defined (SIGHUP)
case SIGHUP:
+#endif
#if defined (SIGTSTP)
case SIGTSTP:
case SIGTTOU:
@@ -397,7 +399,9 @@
sigaddset (&bset, SIGINT);
sigaddset (&bset, SIGTERM);
+#ifdef SIGHUP
sigaddset (&bset, SIGHUP);
+#endif
#if defined (SIGQUIT)
sigaddset (&bset, SIGQUIT);
#endif
@@ -426,7 +430,9 @@
rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
+#ifdef SIGHUP
rl_maybe_set_sighandler (SIGHUP, rl_signal_handler, &old_hup);
+#endif
#if defined (SIGQUIT)
rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
#endif
@@ -491,7 +497,9 @@
overhead */
rl_maybe_restore_sighandler (SIGINT, &old_int);
rl_maybe_restore_sighandler (SIGTERM, &old_term);
+#ifdef SIGHUP
rl_maybe_restore_sighandler (SIGHUP, &old_hup);
+#endif
#if defined (SIGQUIT)
rl_maybe_restore_sighandler (SIGQUIT, &old_quit);
#endif
--- input.c~ 1970-01-01 01:00:00.000000000 +0100
+++ input.c 2016-04-01 20:13:24.293063372 +0200
@@ -532,11 +532,18 @@
Otherwise (not EINTR), some error occurred, also signifying EOF. */
if (errno != EINTR)
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
- else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
+ else if (
+#ifdef SIGHUP
+ _rl_caught_signal == SIGHUP ||
+#endif
+ _rl_caught_signal == SIGTERM)
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
- else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
+ else if (_rl_caught_signal == SIGINT
+#ifdef SIGQUIT
+ || _rl_caught_signal == SIGQUIT
+#endif
+ )
RL_CHECK_SIGNALS ();
-
if (rl_signal_event_hook)
(*rl_signal_event_hook) ();
}
|