Merge pull request #552 from pseiderer/ps-devel-fix-uclibc-compile-002
j1939acd: remove legacy '-p' option (prefix to use when logging)pull/554/head
commit
8a156fee19
16
j1939acd.c
16
j1939acd.c
|
|
@ -38,7 +38,6 @@ static const char help_msg[] =
|
||||||
" e.g. 80,50-100,200-210 (defaults to 0-253)" "\n"
|
" e.g. 80,50-100,200-210 (defaults to 0-253)" "\n"
|
||||||
" -c, --cache=FILE Cache file to save/restore the source address" "\n"
|
" -c, --cache=FILE Cache file to save/restore the source address" "\n"
|
||||||
" -a, --address=ADDRESS Start with Source Address ADDRESS" "\n"
|
" -a, --address=ADDRESS Start with Source Address ADDRESS" "\n"
|
||||||
" -p, --prefix=STR Prefix to use when logging" "\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"NAME is the 64bit nodename" "\n"
|
"NAME is the 64bit nodename" "\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
@ -54,14 +53,13 @@ static struct option long_opts[] = {
|
||||||
{ "range", required_argument, NULL, 'r', },
|
{ "range", required_argument, NULL, 'r', },
|
||||||
{ "cache", required_argument, NULL, 'c', },
|
{ "cache", required_argument, NULL, 'c', },
|
||||||
{ "address", required_argument, NULL, 'a', },
|
{ "address", required_argument, NULL, 'a', },
|
||||||
{ "prefix", required_argument, NULL, 'p', },
|
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
#define getopt_long(argc, argv, optstring, longopts, longindex) \
|
#define getopt_long(argc, argv, optstring, longopts, longindex) \
|
||||||
getopt((argc), (argv), (optstring))
|
getopt((argc), (argv), (optstring))
|
||||||
#endif
|
#endif
|
||||||
static const char optstring[] = "vr:c:a:p:?";
|
static const char optstring[] = "vr:c:a:?";
|
||||||
|
|
||||||
/* byte swap functions */
|
/* byte swap functions */
|
||||||
static inline int host_is_little_endian(void)
|
static inline int host_is_little_endian(void)
|
||||||
|
|
@ -466,9 +464,6 @@ int main(int argc, char *argv[])
|
||||||
struct sockaddr_can saddr;
|
struct sockaddr_can saddr;
|
||||||
uint64_t cmd_name;
|
uint64_t cmd_name;
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
|
||||||
program_invocation_name = program_invocation_short_name;
|
|
||||||
#endif
|
|
||||||
/* argument parsing */
|
/* argument parsing */
|
||||||
while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1)
|
while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1)
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
|
@ -484,15 +479,6 @@ int main(int argc, char *argv[])
|
||||||
case 'a':
|
case 'a':
|
||||||
s.current_sa = strtoul(optarg, 0, 0);
|
s.current_sa = strtoul(optarg, 0, 0);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
|
||||||
#ifdef _GNU_SOURCE
|
|
||||||
if (asprintf(&program_invocation_name, "%s.%s",
|
|
||||||
program_invocation_short_name, optarg) < 0)
|
|
||||||
err(1, "asprintf(program invocation name)");
|
|
||||||
#else
|
|
||||||
err(0, "compile with -D_GNU_SOURCE to use -p");
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
fputs(help_msg, stderr);
|
fputs(help_msg, stderr);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,6 @@ int main(int argc, char **argv)
|
||||||
struct pollfd pfd[2];
|
struct pollfd pfd[2];
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
|
||||||
program_invocation_name = program_invocation_short_name;
|
|
||||||
#endif
|
|
||||||
/* argument parsing */
|
/* argument parsing */
|
||||||
while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1)
|
while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1)
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue