Oliver Hartkopp
7939678070
can-utils: unify indention
...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2025-12-13 10:38:15 +01:00
TyK
ceda93bd5c
timestamp formatting: always use 64-bit for timesstamp formatting.
...
Using C99 `unsigned long long` to format `struct timeval`'s `tv_sec`
and `tv_usec`, fix incorrect print under some 32bit platform which
using time64.
2023-11-28 08:30:27 +08:00
Oliver Hartkopp
dfb607c807
remove obsolete char pointer casts
...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2022-03-14 18:21:45 +01:00
Oliver Hartkopp
f7307b8290
can-utils: check for return values of if_nametoindex()
...
if_nametoindex() returns zero and a specific errno in the case the network
interface does not exist. The missing check leads to the use of the 'any'
CAN device but leaves the user alone as the user gets no error message.
Reported-by: Lothar Rubusch <lotophagon@protonmail.com >
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2021-10-18 09:37:46 +02:00
Rosen Penev
f766174677
custom if statement reordering
...
It makes more sense to return before hitting else.
Signed-off-by: Rosen Penev <rosenp@gmail.com >
2020-10-12 23:48:38 -07:00
Rosen Penev
b153fe3f35
clang-tidy: sort includes alphabetically
...
Found with llvm-include-order
Signed-off-by: Rosen Penev <rosenp@gmail.com >
2020-10-12 23:28:58 -07:00
Rosen Penev
17a5fe6022
clang-tidy: do not use else after return
...
Found with readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com >
2020-10-12 23:28:22 -07:00
Oliver Hartkopp
a4905ed7c8
fix timeval to ASCII unsigned value conversion
...
As reported by Oleksij Rempel here
https://github.com/linux-can/can-utils/issues/233#issuecomment-674818935
the representation of timeval timestamps are signed values which leads to
negative values on 32 bit machines addressing the year 2038 unix sec counter
overflow.
Fix the issue on 32 bit systems by converting the timeval values to unsigned
ASCII value representations.
Fixes: https://github.com/linux-can/can-utils/issues/234
Reported-by: Oleksij Rempel <o.rempel@pengutronix.de >
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2020-08-18 12:51:35 +02:00
Gary Bisson and Oliver Hartkopp
46895a41c5
Fix comparison type mismatch warnings
...
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com >
2020-05-28 20:54:37 +02:00
Alexander Gerasiov and Alexander Gerasiov
4db63e4b55
isotpperf.c: Reformat help/usage output to be compatible with help2man.
...
Signed-off-by: Alexander Gerasiov <gq@debian.org >
Gbp-Pq: Name 0013-isotpperf.c-Reformat-help-usage-output-to-be-compati.patch
2020-04-27 08:20:09 +03:00
Fabrice Fontaine
e9590b1ca7
fix include to find SIOCGSTAMP with latest kernel
...
In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
Instead it provides only SIOCGSTAMP_OLD.
The linux/sockios.h header now defines SIOCGSTAMP using either
SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
header file is not pulled so we get a build failure.
canlogserver.c: In function 'main':
canlogserver.c:404:21: error: 'SIOCGSTAMP' undeclared (first use in this function); did you mean 'SIOCGRARP'?
if (ioctl(s[i], SIOCGSTAMP, &tv) < 0)
^~~~~~~~~~
SIOCGRARP
canlogserver.c:404:21: note: each undeclared identifier is reported only once for each function it appears in
Fixes:
- http://autobuild.buildroot.org/results/363de7d9bf433be8bc47ba4ee52ae0bb80fa9021
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com >
2019-07-14 22:14:10 +02:00
Yegor Yefremov
7b7331976a
Add SPDX identifiers
...
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com >
2019-06-19 12:24:24 +02:00
Marc Kleine-Budde
002f8eba87
isotp: fix printf warning on 32 bit systems
...
Use "z" modifier to print sizeof() values.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de >
2015-03-03 08:29:36 +01:00
Oliver Hartkopp
e71816295b
isotpperf: print link layer data length of measured PDU
...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2015-02-23 10:37:13 +01:00
Oliver Hartkopp
7e1b18f756
isotpperf: display bitrate setting status in summary
...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2015-02-23 10:22:59 +01:00
Oliver Hartkopp
97f64049ac
isotpperf: fix printed FC STMin value
...
Additionally remove the already removed -f option from the help text.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2015-02-23 10:03:12 +01:00
Oliver Hartkopp
c1ac5613fd
can-utils: added isotpperf tool for performance measurements
...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net >
2015-02-04 10:17:38 +01:00