Deleted Added
full compact
ctladm.c (256190) ctladm.c (256191)
1/*-
2 * Copyright (c) 2003, 2004 Silicon Graphics International Corp.
3 * Copyright (c) 1997-2007 Kenneth D. Merry
4 * Copyright (c) 2012 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

--- 27 unchanged lines hidden (view full) ---

36 */
37/*
38 * CAM Target Layer exercise program.
39 *
40 * Author: Ken Merry <ken@FreeBSD.org>
41 */
42
43#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003, 2004 Silicon Graphics International Corp.
3 * Copyright (c) 1997-2007 Kenneth D. Merry
4 * Copyright (c) 2012 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

--- 27 unchanged lines hidden (view full) ---

36 */
37/*
38 * CAM Target Layer exercise program.
39 *
40 * Author: Ken Merry <ken@FreeBSD.org>
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/usr.sbin/ctladm/ctladm.c 256190 2013-10-09 12:19:48Z trasz $");
44__FBSDID("$FreeBSD: head/usr.sbin/ctladm/ctladm.c 256191 2013-10-09 12:30:52Z trasz $");
45
46#include <sys/ioctl.h>
47#include <sys/types.h>
48#include <sys/stat.h>
49#include <sys/param.h>
50#include <sys/linker.h>
51#include <sys/queue.h>
52#include <sys/callout.h>

--- 3384 unchanged lines hidden (view full) ---

3437{
3438 int i;
3439 struct cctl_islist_data *islist;
3440 struct cctl_islist_conn *cur_conn;
3441
3442 islist = (struct cctl_islist_data *)user_data;
3443 cur_conn = islist->cur_conn;
3444 islist->level++;
45
46#include <sys/ioctl.h>
47#include <sys/types.h>
48#include <sys/stat.h>
49#include <sys/param.h>
50#include <sys/linker.h>
51#include <sys/queue.h>
52#include <sys/callout.h>

--- 3384 unchanged lines hidden (view full) ---

3437{
3438 int i;
3439 struct cctl_islist_data *islist;
3440 struct cctl_islist_conn *cur_conn;
3441
3442 islist = (struct cctl_islist_data *)user_data;
3443 cur_conn = islist->cur_conn;
3444 islist->level++;
3445 if ((u_int)islist->level > (sizeof(islist->cur_sb) /
3445 if ((u_int)islist->level >= (sizeof(islist->cur_sb) /
3446 sizeof(islist->cur_sb[0])))
3447 errx(1, "%s: too many nesting levels, %zd max", __func__,
3448 sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]));
3449
3450 islist->cur_sb[islist->level] = sbuf_new_auto();
3451 if (islist->cur_sb[islist->level] == NULL)
3452 err(1, "%s: Unable to allocate sbuf", __func__);
3453

--- 389 unchanged lines hidden (view full) ---

3843{
3844 int i;
3845 struct cctl_devlist_data *devlist;
3846 struct cctl_lun *cur_lun;
3847
3848 devlist = (struct cctl_devlist_data *)user_data;
3849 cur_lun = devlist->cur_lun;
3850 devlist->level++;
3446 sizeof(islist->cur_sb[0])))
3447 errx(1, "%s: too many nesting levels, %zd max", __func__,
3448 sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]));
3449
3450 islist->cur_sb[islist->level] = sbuf_new_auto();
3451 if (islist->cur_sb[islist->level] == NULL)
3452 err(1, "%s: Unable to allocate sbuf", __func__);
3453

--- 389 unchanged lines hidden (view full) ---

3843{
3844 int i;
3845 struct cctl_devlist_data *devlist;
3846 struct cctl_lun *cur_lun;
3847
3848 devlist = (struct cctl_devlist_data *)user_data;
3849 cur_lun = devlist->cur_lun;
3850 devlist->level++;
3851 if ((u_int)devlist->level > (sizeof(devlist->cur_sb) /
3851 if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) /
3852 sizeof(devlist->cur_sb[0])))
3853 errx(1, "%s: too many nesting levels, %zd max", __func__,
3854 sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));
3855
3856 devlist->cur_sb[devlist->level] = sbuf_new_auto();
3857 if (devlist->cur_sb[devlist->level] == NULL)
3858 err(1, "%s: Unable to allocate sbuf", __func__);
3859

--- 671 unchanged lines hidden ---
3852 sizeof(devlist->cur_sb[0])))
3853 errx(1, "%s: too many nesting levels, %zd max", __func__,
3854 sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));
3855
3856 devlist->cur_sb[devlist->level] = sbuf_new_auto();
3857 if (devlist->cur_sb[devlist->level] == NULL)
3858 err(1, "%s: Unable to allocate sbuf", __func__);
3859

--- 671 unchanged lines hidden ---