From 9f51714eb874123df33b009a5fb30d8083b74cb1 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 6 Feb 2023 16:59:20 +0100 Subject: [PATCH] j1939acd, j1939sr: remove use of program_invocation_name and program_invocation_short_name Link: https://github.com/linux-can/can-utils/issues/404 --- j1939acd.c | 12 +----------- j1939sr.c | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/j1939acd.c b/j1939acd.c index a1d71621..525888b8 100644 --- a/j1939acd.c +++ b/j1939acd.c @@ -38,7 +38,7 @@ static const char help_msg[] = " e.g. 80,50-100,200-210 (defaults to 0-253)" "\n" " -c, --cache=FILE Cache file to save/restore the source address" "\n" " -a, --address=ADDRESS Start with Source Address ADDRESS" "\n" - " -p, --prefix=STR Prefix to use when logging" "\n" + " -p, --prefix=STR Prefix to use when logging (deprecated)" "\n" "\n" "NAME is the 64bit nodename" "\n" "\n" @@ -466,9 +466,6 @@ int main(int argc, char *argv[]) struct sockaddr_can saddr; uint64_t cmd_name; -#ifdef _GNU_SOURCE - program_invocation_name = program_invocation_short_name; -#endif /* argument parsing */ while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1) switch (opt) { @@ -485,13 +482,6 @@ int main(int argc, char *argv[]) s.current_sa = strtoul(optarg, 0, 0); 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: fputs(help_msg, stderr); diff --git a/j1939sr.c b/j1939sr.c index cdf6da57..fafed3a5 100644 --- a/j1939sr.c +++ b/j1939sr.c @@ -94,9 +94,6 @@ int main(int argc, char **argv) struct pollfd pfd[2]; uint8_t *buf; -#ifdef _GNU_SOURCE - program_invocation_name = program_invocation_short_name; -#endif /* argument parsing */ while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL)) != -1) switch (opt) {