cansend: convert towards kernel coding style
parent
c41f9cb21b
commit
82be1b348b
12
cansend.c
12
cansend.c
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
|
|
||||||
void print_usage(char *prg)
|
static void print_usage(char *prg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s - send CAN-frames via CAN_RAW sockets.\n", prg);
|
fprintf(stderr, "%s - send CAN-frames via CAN_RAW sockets.\n", prg);
|
||||||
fprintf(stderr, "\nUsage: %s <device> <can_frame>.\n", prg);
|
fprintf(stderr, "\nUsage: %s <device> <can_frame>.\n", prg);
|
||||||
|
|
@ -147,10 +147,12 @@ int main(int argc, char **argv)
|
||||||
frame.len = can_fd_dlc2len(can_fd_len2dlc(frame.len));
|
frame.len = can_fd_dlc2len(can_fd_len2dlc(frame.len));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disable default receive filter on this RAW socket */
|
/*
|
||||||
/* This is obsolete as we do not read from the socket at all, but for */
|
* disable default receive filter on this RAW socket This is
|
||||||
/* this reason we can remove the receive list in the Kernel to save a */
|
* obsolete as we do not read from the socket at all, but for
|
||||||
/* little (really a very little!) CPU usage. */
|
* this reason we can remove the receive list in the Kernel to
|
||||||
|
* save a little (really a very little!) CPU usage.
|
||||||
|
*/
|
||||||
setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
|
setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
|
||||||
|
|
||||||
if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue