Skip to content

Commit 6751182

Browse files
extinguishThePassionate
authored andcommitted
system/cu: make the cu tool can work with SIGNAL disabled
Use CONFIG_DISABLE_SIGNALS to conditionally compile signal handling code, allowing cu to work on systems with signals disabled. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
1 parent f8c30c6 commit 6751182

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

system/cu/cu_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static FAR void *cu_listener(FAR void *parameter)
153153
return NULL;
154154
}
155155

156-
#ifdef CONFIG_ENABLE_ALL_SIGNALS
156+
#ifndef CONFIG_DISABLE_SIGNALS
157157
static void cu_exit(int signo, FAR siginfo_t *siginfo, FAR void *context)
158158
{
159159
FAR struct cu_globals_s *cu = siginfo->si_user;
@@ -307,7 +307,7 @@ static int cu_cmd(FAR struct cu_globals_s *cu, char bcmd)
307307
int main(int argc, FAR char *argv[])
308308
{
309309
pthread_attr_t attr;
310-
#ifdef CONFIG_ENABLE_ALL_SIGNALS
310+
#ifndef CONFIG_DISABLE_SIGNALS
311311
struct sigaction sa;
312312
#endif
313313
struct cu_globals_s cu;
@@ -329,7 +329,8 @@ int main(int argc, FAR char *argv[])
329329

330330
memset(&cu, 0, sizeof(cu));
331331
cu.escape = '~';
332-
#ifdef CONFIG_ENABLE_ALL_SIGNALS
332+
333+
#ifndef CONFIG_DISABLE_SIGNALS
333334
/* Install signal handlers */
334335

335336
memset(&sa, 0, sizeof(sa));
@@ -343,6 +344,7 @@ int main(int argc, FAR char *argv[])
343344
return EXIT_FAILURE;
344345
}
345346
#endif
347+
346348
optind = 0; /* Global that needs to be reset in FLAT mode */
347349
while ((option = getopt(argc, argv, "l:s:ceE:fho?")) != ERROR)
348350
{

0 commit comments

Comments
 (0)