projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d219fe2
)
Allow control-C to stop tincd without stopping the tinc shell.
author
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 25 Jul 2013 15:14:07 +0000
(17:14 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 25 Jul 2013 15:30:47 +0000
(17:30 +0200)
src/tincctl.c
patch
|
blob
|
history
diff --git
a/src/tincctl.c
b/src/tincctl.c
index d02bda52e1b2ded0cbbaa5072a9b2f1a7f4f627a..a49654847f158d74c0cbafce1e9307a45c768122 100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-830,8
+830,16
@@
static int cmd_start(int argc, char *argv[]) {
free(nargv);
- int status = -1;
- if(waitpid(pid, &status, 0) != pid || !WIFEXITED(status) || WEXITSTATUS(status)) {
+ int status = -1, result;
+#ifdef SIGINT
+ signal(SIGINT, SIG_IGN);
+#endif
+ result = waitpid(pid, &status, 0);
+#ifdef SIGINT
+ signal(SIGINT, SIG_DFL);
+#endif
+
+ if(result != pid || !WIFEXITED(status) || WEXITSTATUS(status)) {
fprintf(stderr, "Error starting %s\n", c);
return 1;
}