summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2006-03-22 14:42:52 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2006-03-22 14:42:52 +0000
commitd1b9d41889051c4623cea31da973c61116ed297b (patch)
tree9a9a09a57752962abcd256101c6cf07682a0435b
parent9d8c9536b3808c2300eca2cdec29543e80535654 (diff)
downloadcanutils-d1b9d41889051c4623cea31da973c61116ed297b.tar.gz
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.1-trunk@63 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
-rw-r--r--src/candump.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/candump.c b/src/candump.c
index 78acdbf..844bd58 100644
--- a/src/candump.c
+++ b/src/candump.c
@@ -83,8 +83,6 @@ int main(int argc, char **argv)
int n = 0, err;
signal(SIGPIPE, SIG_IGN);
- signal(SIGTERM, sigterm);
- signal(SIGHUP, sigterm);
struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
@@ -181,6 +179,13 @@ int main(int argc, char **argv)
}
}
+ if (optdaemon)
+ daemon(1, 0);
+ else {
+ signal(SIGTERM, sigterm);
+ signal(SIGHUP, sigterm);
+ }
+
if (optout) {
out = fopen(optout, "a");
if (!out) {
@@ -189,9 +194,6 @@ int main(int argc, char **argv)
}
}
- if (optdaemon)
- daemon(1, 0);
-
while (running) {
if ((nbytes = read(s, &frame, sizeof(struct can_frame))) < 0) {
perror("read");