Skip to content

Commit 107b636

Browse files
TangMeng12extinguish
authored andcommitted
examples: fix the compilation error caused by CONFIG_DISABLE_SIGNALS
The commit 'add support for CONFIG_DISABLE_SIGNALS' led to: undefined reference to `signal' undefined reference to `sigaction' Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
1 parent 67dd5d2 commit 107b636

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/buttons/buttons_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,11 @@ static int button_daemon(int argc, char *argv[])
219219
goto errout_with_fd;
220220
}
221221

222+
#ifndef CONFIG_DISABLE_SIGNALS
222223
/* Ignore the default signal action */
223224

224225
signal(CONFIG_EXAMPLES_BUTTONS_SIGNO, SIG_IGN);
226+
#endif
225227
#endif
226228

227229
/* Now loop forever, waiting BUTTONs events */

examples/chrono/chrono_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ static int chrono_daemon(int argc, char *argv[])
165165
goto errout_with_fd;
166166
}
167167

168+
#ifndef CONFIG_DISABLE_SIGNALS
168169
/* Ignore the default signal action */
169170

170171
signal(BUTTON_SIGNO, SIG_IGN);
172+
#endif
171173

172174
/* Now loop forever, waiting BUTTONs events */
173175

0 commit comments

Comments
 (0)