When canbusload is executed without bit rate, it exits with an exit
code of 1 and prints help, but without explaining why. Users cannot
know what was wrong. When other errors occur, though, canbusload
prints an error message along with the help.
Print an error message when bit rate is not given or "@" is not found.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
slcand was returning 0 when SIGINT and SIGTERM is received. This
commit, instead, return 128 + signum when it gets a signal.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
For j1939acd.c, it was using s.sig_term as a boolean key to exit from
the while loop. This commit replaces a.sig_term with a.signal_num,
which holds the signal it received.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
canfdtest.c was effectively raising the received signal again to run
the default signal handler. This has been declined by the maintainer
because it's over-engineering. This commit replaces it with the
method proposed by the maintainer.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
canlogserver.c was using a non-safe function, exit(3), in the signal
handler. This commit replaces it with the way other programs in
can-utils are using; set running = 0 to exit from the while loop.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
canbusload.c was using a non-safe function, exit(3), in the signal
handler. This commit replaces it with the way other programs in
can-utils are using; set running = 0 to exit from the while loop.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Bash and many other shells use 128 + signum as the exit status when a
program get signal and exit. Follow the common behavior so that we
know how the programs are killed.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>