From owner-svn-src-head@FreeBSD.ORG Thu Apr 19 02:48:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E2F106564A; Thu, 19 Apr 2012 02:48:33 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5FA3F8FC0A; Thu, 19 Apr 2012 02:48:33 +0000 (UTC) Received: by pbcwz17 with SMTP id wz17so10282412pbc.13 for ; Wed, 18 Apr 2012 19:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=fBXDzGd0AwyzdhAT7MFq+j0t5UbterKoD5zH65vjqs4=; b=AFXczCb34Qt6ugQX0LLAfIiAQYFUP2wBDDU335u1KJNwz0Yvn2g4IzGfxTotN46WW8 2OA9YS9UzR1bapz1qIK5aEGVsInkF1jqCr931UnQtxzE3PSo7lKFbw8YesVrqtvzl18s l2Q3HG49Q4w0xBRt7ZL6uUf5qW9+tBExKw9/0amjXqzoXGc6k1emnAKp+dwPAgelPEK6 c1AdiDRjMutbN9Bp5+ctIKi1uwrcgUqF7GJwaF+jLiyPWGmMPLQqPKKnjjHwhLTRrSQn j8UhpsxQjopGJ0C1gTMClD+SQNZxBPdDRWU8p5a9WiEPdktSQOxSByyhTAEh1xUBm4U1 sA5w== Received: by 10.68.221.74 with SMTP id qc10mr1189964pbc.80.1334803712827; Wed, 18 Apr 2012 19:48:32 -0700 (PDT) Received: from [10.67.255.244] (mobile-166-147-082-087.mycingular.net. [166.147.82.87]) by mx.google.com with ESMTPS id i1sm867332pbj.70.2012.04.18.19.48.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Apr 2012 19:48:31 -0700 (PDT) References: <201204181647.q3IGlvjq040763@svn.freebsd.org> In-Reply-To: <201204181647.q3IGlvjq040763@svn.freebsd.org> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (9B176) From: Garrett Cooper Date: Wed, 18 Apr 2012 19:48:19 -0700 To: Josh Paetzel Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r234425 - in head: sbin/iscontrol sys/modules/iscsi/initiator X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 02:48:33 -0000 On Apr 18, 2012, at 9:47 AM, Josh Paetzel wrote: > Author: jpaetzel > Date: Wed Apr 18 16:47:57 2012 > New Revision: 234425 > URL: http://svn.freebsd.org/changeset/base/234425 >=20 > Log: > Unbreak tinderbox. >=20 > Fix FreeBSD paradigms in the upstream code. >=20 > PR: bin/166933 > Submitted by: Garrett Cooper >=20 > Modified: > head/sbin/iscontrol/Makefile > head/sbin/iscontrol/iscontrol.c > head/sys/modules/iscsi/initiator/Makefile >=20 > Modified: head/sbin/iscontrol/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sbin/iscontrol/Makefile Wed Apr 18 16:29:55 2012 (r234424) > +++ head/sbin/iscontrol/Makefile Wed Apr 18 16:47:57 2012 (r234425) > @@ -7,8 +7,7 @@ LDADD=3D -lcam -lmd > S=3D ${.CURDIR}/../../sys >=20 > WARNS?=3D 3 > -CFLAGS +=3D -I$S > -CFLAGS +=3D -g -DDEBUG > +CFLAGS+=3D -I$S >=20 > MAN=3D iscsi.conf.5 iscontrol.8 >=20 >=20 > Modified: head/sbin/iscontrol/iscontrol.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sbin/iscontrol/iscontrol.c Wed Apr 18 16:29:55 2012 (r23442= 4) > +++ head/sbin/iscontrol/iscontrol.c Wed Apr 18 16:47:57 2012 (r23442= 5) > @@ -44,13 +44,15 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > -#include > -#include > +#include > #include > #include > +#include > +#include > +#include > +#include > #include > +#include > #include >=20 > #include > @@ -111,6 +113,13 @@ isc_opt_t opvals =3D { > .immediateData =3D TRUE, > }; >=20 > +static void > +usage(const char *pname) > +{ > + fprintf(stderr, "usage: %s " USAGE "\n", pname); > + exit(1); > +} > + > int > lookup(token_t *tbl, char *m) > { > @@ -135,8 +144,8 @@ main(int cc, char **vv) > iscsidev =3D "/dev/"ISCSIDEV; > fd =3D NULL; > pname =3D vv[0]; > - if((p =3D strrchr(pname, '/')) !=3D NULL) > - pname =3D p + 1; > + if ((pname =3D basename(pname)) =3D=3D NULL) > + err(1, "basename"); >=20 > kw =3D ta =3D 0; > disco =3D 0; > @@ -145,17 +154,21 @@ main(int cc, char **vv) > | check for driver & controller version match > */ > n =3D 0; > - if(sysctlbyname("net.iscsi_initiator.driver_version", 0, &n, 0, 0) != =3D 0) > - perror("sysctlbyname"); > - v =3D malloc(n+1); > - if(sysctlbyname("net.iscsi_initiator.driver_version", v, &n, 0, 0) != =3D 0) > - perror("sysctlbyname"); > - > - if(strncmp(version, v, 3)) { > - fprintf(stderr, "versions missmatch\n"); > - exit(1); > +#define VERSION_OID_S "net.iscsi_initiator.driver_version" > + if (sysctlbyname(VERSION_OID_S, 0, &n, 0, 0) !=3D 0) { > + if (errno =3D=3D ENOENT) > + errx(1, "sysctlbyname(\"" VERSION_OID_S "\") " > + "failed; is the iscsi driver loaded?"); > + err(1, "sysctlbyname(\"" VERSION_OID_S "\")"); > } > + v =3D malloc(n+1); > + if (v =3D=3D NULL) > + err(1, "malloc"); > + if (sysctlbyname(VERSION_OID_S, v, &n, 0, 0) !=3D 0) > + err(1, "sysctlbyname"); >=20 > + if (strncmp(version, v, 3) !=3D 0) > + errx(1, "versions mismatch"); >=20 > while((ch =3D getopt(cc, vv, OPTIONS)) !=3D -1) { > switch(ch) { > @@ -164,10 +177,8 @@ main(int cc, char **vv) > break; > case 'c': > fd =3D fopen(optarg, "r"); > - if(fd =3D=3D NULL) { > - perror(optarg); > - exit(1); > - } > + if (fd =3D=3D NULL) > + err(1, "fopen(\"%s\")", optarg); > break; > case 'd': > disco =3D 1; > @@ -182,9 +193,7 @@ main(int cc, char **vv) > pidfile =3D optarg; > break; > default: > - badu: > - fprintf(stderr, "Usage: %s %s\n", pname, USAGE); > - exit(1); > + usage(pname); > } > } > if(fd =3D=3D NULL) > @@ -205,8 +214,8 @@ main(int cc, char **vv) > op->targetAddress =3D ta; >=20 > if(op->targetAddress =3D=3D NULL) { > - fprintf(stderr, "No target!\n"); > - goto badu; > + warnx("no target specified!"); > + usage(pname); > } > q =3D op->targetAddress; > if(*q =3D=3D '[' && (q =3D strchr(q, ']')) !=3D NULL) { > @@ -224,7 +233,7 @@ main(int cc, char **vv) > op->targetPortalGroupTag =3D atoi(p); > } > if(op->initiatorName =3D=3D 0) { > - char hostname[256]; > + char hostname[MAXHOSTNAMELEN]; >=20 > if(op->iqn) { > if(gethostname(hostname, sizeof(hostname)) =3D=3D 0) >=20 > Modified: head/sys/modules/iscsi/initiator/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/modules/iscsi/initiator/Makefile Wed Apr 18 16:29:55 2012 = (r234424) > +++ head/sys/modules/iscsi/initiator/Makefile Wed Apr 18 16:47:57 2012 = (r234425) > @@ -10,7 +10,9 @@ SRCS+=3D iscsi.c isc_cam.c isc_soc.c isc_s > SRCS+=3D opt_cam.h opt_iscsi_initiator.h > SRCS+=3D bus_if.h device_if.h > #CFLAGS+=3D -DNO_USE_MBUF > +CFLAGS+=3D -DISCSI_INITIATOR_DEBUG=3D2 > #CFLAGS+=3D -DISCSI_INITIATOR_DEBUG=3D2 > +CFLAGS+=3D -DINVARIANTS > CFLAGS+=3D -I$S > CFLAGS+=3D -DINVARIANTS > .include Uh... Somehow the diff I provided got reversed. This commit broke tinderbox [= again] ;/... -Garrett