identify.c (253115) | identify.c (253116) |
---|---|
1/*- 2 * Copyright (C) 2012-2013 Intel Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2012-2013 Intel Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sbin/nvmecontrol/identify.c 253115 2013-07-09 21:31:58Z jimharris $"); | 28__FBSDID("$FreeBSD: head/sbin/nvmecontrol/identify.c 253116 2013-07-09 21:33:12Z jimharris $"); |
29 30#include <sys/param.h> 31 32#include <ctype.h> 33#include <err.h> 34#include <fcntl.h> 35#include <stddef.h> 36#include <stdio.h> --- 217 unchanged lines hidden (view full) --- 254{ 255 char *target; 256 257 if (argc < 2) 258 identify_usage(); 259 260 while (getopt(argc, argv, "vx") != -1) ; 261 | 29 30#include <sys/param.h> 31 32#include <ctype.h> 33#include <err.h> 34#include <fcntl.h> 35#include <stddef.h> 36#include <stdio.h> --- 217 unchanged lines hidden (view full) --- 254{ 255 char *target; 256 257 if (argc < 2) 258 identify_usage(); 259 260 while (getopt(argc, argv, "vx") != -1) ; 261 |
262 /* Check that a controller or namespace was specified. */ 263 if (optind >= argc) 264 identify_usage(); 265 |
|
262 target = argv[optind]; 263 264 optreset = 1; 265 optind = 1; 266 267 /* 268 * If device node contains "ns", we consider it a namespace, 269 * otherwise, consider it a controller. 270 */ 271 if (strstr(target, NVME_NS_PREFIX) == NULL) 272 identify_ctrlr(argc, argv); 273 else 274 identify_ns(argc, argv); 275} | 266 target = argv[optind]; 267 268 optreset = 1; 269 optind = 1; 270 271 /* 272 * If device node contains "ns", we consider it a namespace, 273 * otherwise, consider it a controller. 274 */ 275 if (strstr(target, NVME_NS_PREFIX) == NULL) 276 identify_ctrlr(argc, argv); 277 else 278 identify_ns(argc, argv); 279} |