From 8f6554366bcf6f7b07a52ea802856aeedc36645a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 1 Mar 2019 15:34:17 -0600 Subject: Minor tweaks. --- toys/other/vconfig.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'toys/other') diff --git a/toys/other/vconfig.c b/toys/other/vconfig.c index fd785273..83674d8b 100644 --- a/toys/other/vconfig.c +++ b/toys/other/vconfig.c @@ -4,8 +4,6 @@ * Copyright 2012 Kyungwan Han * * No standard - * - * TODO: cleanup USE_VCONFIG(NEWTOY(vconfig, "<2>4", TOYFLAG_NEEDROOT|TOYFLAG_SBIN)) @@ -32,17 +30,15 @@ config VCONFIG void vconfig_main(void) { struct vlan_ioctl_args request; - char *cmd; - int fd; + char *cmd = *toys.optargs; + int fd = xsocket(AF_INET, SOCK_STREAM, 0); - fd = xsocket(AF_INET, SOCK_STREAM, 0); memset(&request, 0, sizeof(struct vlan_ioctl_args)); - cmd = toys.optargs[0]; if (!strcmp(cmd, "set_name_type")) { char *types[] = {"VLAN_PLUS_VID", "DEV_PLUS_VID", "VLAN_PLUS_VID_NO_PAD", "DEV_PLUS_VID_NO_PAD"}; - int i, j = sizeof(types)/sizeof(*types); + int i, j = ARRAY_LEN(types); for (i=0; i