mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
slcand: move setting of loop variable back into code context
With commit 33a9249571 ("slcand: daemonise only once setup is complete")
the daemonize syscall is moved behind serial tty setup.
This patch moves the missing assignment of the loop variable slcand_running
to get it into the code context of the while() loop.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -280,9 +280,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
syslogger(LOG_INFO, "starting on TTY device %s", ttypath);
|
syslogger(LOG_INFO, "starting on TTY device %s", ttypath);
|
||||||
|
|
||||||
/* */
|
|
||||||
slcand_running = 1;
|
|
||||||
|
|
||||||
fd = open(ttypath, O_RDWR | O_NONBLOCK | O_NOCTTY);
|
fd = open(ttypath, O_RDWR | O_NONBLOCK | O_NOCTTY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
syslogger(LOG_NOTICE, "failed to open TTY device %s\n", ttypath);
|
syslogger(LOG_NOTICE, "failed to open TTY device %s\n", ttypath);
|
||||||
@@ -399,6 +396,8 @@ int main(int argc, char *argv[])
|
|||||||
signal(SIGTERM, child_handler);
|
signal(SIGTERM, child_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slcand_running = 1;
|
||||||
|
|
||||||
/* The Big Loop */
|
/* The Big Loop */
|
||||||
while (slcand_running)
|
while (slcand_running)
|
||||||
sleep(1); /* wait 1 second */
|
sleep(1); /* wait 1 second */
|
||||||
|
|||||||
Reference in New Issue
Block a user