| cangen.c: In function ‘parse_dataoptarg’:
| cangen.c:422:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < CANFD_MAX_DLEN && i < arglen / 2; i++) {
| ^
| cangen.c:422:2: note: use option -std=c99 or -std=gnu99 to compile your code
| cangen.c: In function ‘main’:
| cangen.c:796:4: error: ‘for’ loop initial declarations are only allowed in C99 mode
| for (int i = 0; i < frame.len; i++) {
| ^
Reported-by: https://github.com/yannS2016
Link: https://github.com/linux-can/can-utils/issues/428
Fixes: e409aa4c8c ("cangen: new generation mode - partially randomized payload (-D)")
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>
Update includes to support CAN XL and latest CAN netlink features.
Upstream commits:
(1a3e3034c049) "can: canxl: introduce CAN XL data structure"
(061834624c87) "can: set CANFD_FDF flag in all CAN FD frame structures"
(94dfc73e7cf4) "treewide: uapi: Replace zero-length arrays with flexible-array members"
(383f0993fc77) "can: netlink: report the CAN controller mode supported flags"
(d99755f71a80) "can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC)"
(63dfe0709643) "can: bittiming: allow TDC{V,O} to be zero and add can_tdc_const::tdc{v,o,f}_min"
(626332696d75) "can: raw: add CAN XL support"
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Part of the fixed data payload can be randomized using the 'x' character.
Nibbles marked with 'x' will be randomized.
For example $ vcan0 -D 11xx3344DEADBEEF -L 8:
-> second byte of the payload will be randomized.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The commit c6f2cf7c2f ("cangen: add support for SO_TXTIME") relies
on several toolchain features ("CLOCK_TAI", "SO_TXTIME", "SCM_TXTIME")
which are not present in old toolchain.
Add defines to fix compilation on older toolchains.
Reported-by: https://github.com/b-thomson
Link: https://github.com/linux-can/can-utils/issues/398
Fixes: c6f2cf7c2f ("cangen: add support for SO_TXTIME")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Without the corresponding include file, these macros get always defined
locally and thus, shadows the ones from the system. This change ensures,
if the macros are found already defined in the system, then they are used.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>