commit
dec3c5eda1
|
|
@ -2,13 +2,15 @@ cmake_minimum_required(VERSION 3.3)
|
|||
|
||||
project(can-utils LANGUAGES C)
|
||||
|
||||
include (CheckSymbolExists)
|
||||
include (GNUInstallDirs)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
|
||||
if(_GNU_SOURCE)
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt,
|
|||
unsigned int spt_nominal; /* nominal sample point */
|
||||
unsigned int best_tseg = 0; /* current best value for tseg */
|
||||
unsigned int best_brp = 0; /* current best value for brp */
|
||||
unsigned int brp, tsegall, tseg, tseg1, tseg2;
|
||||
unsigned int brp, tsegall, tseg, tseg1 = 0, tseg2 = 0;
|
||||
u64 v64;
|
||||
|
||||
/* Use CiA recommended sample points */
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ static int j1939cat_parse_args(struct j1939cat_priv *priv, int argc, char *argv[
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct j1939cat_priv *priv;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
priv = malloc(sizeof(*priv));
|
||||
if (!priv)
|
||||
|
|
@ -679,6 +679,6 @@ int main(int argc, char *argv[])
|
|||
close(priv->infile);
|
||||
close(priv->outfile);
|
||||
close(priv->sock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,17 +24,18 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <libgen.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libgen.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue