mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
Save argv[0] and use it in usage message.
This commit is contained in:
parent
c7ae8b4fa8
commit
478521fa8d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144982
@ -56,6 +56,8 @@
|
|||||||
|
|
||||||
#include "../../../sys/net80211/ieee80211_ioctl.h"
|
#include "../../../sys/net80211/ieee80211_ioctl.h"
|
||||||
|
|
||||||
|
const char *progname;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
printstats(FILE *fd, const struct ieee80211_stats *stats)
|
printstats(FILE *fd, const struct ieee80211_stats *stats)
|
||||||
{
|
{
|
||||||
@ -229,6 +231,8 @@ main(int argc, char *argv[])
|
|||||||
struct ieee80211req ireq;
|
struct ieee80211req ireq;
|
||||||
int allnodes = 0;
|
int allnodes = 0;
|
||||||
|
|
||||||
|
progname = argv[0];
|
||||||
|
|
||||||
s = socket(AF_INET, SOCK_DGRAM, 0);
|
s = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
err(1, "socket");
|
err(1, "socket");
|
||||||
@ -242,7 +246,7 @@ main(int argc, char *argv[])
|
|||||||
strncpy(ifr.ifr_name, optarg, sizeof (ifr.ifr_name));
|
strncpy(ifr.ifr_name, optarg, sizeof (ifr.ifr_name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errx(1, "usage: %s [-a] [-i device] [mac...]\n");
|
errx(1, "usage: %s [-a] [-i device] [mac...]\n", progname);
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user