From owner-svn-src-all@FreeBSD.ORG Mon Feb 10 15:03:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96EFD51C; Mon, 10 Feb 2014 15:03:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8012B15FB; Mon, 10 Feb 2014 15:03:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1AF38OL072524; Mon, 10 Feb 2014 15:03:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1AF38vK072523; Mon, 10 Feb 2014 15:03:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201402101503.s1AF38vK072523@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 10 Feb 2014 15:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261713 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Feb 2014 15:03:08 -0000 Author: trasz Date: Mon Feb 10 15:03:08 2014 New Revision: 261713 URL: http://svnweb.freebsd.org/changeset/base/261713 Log: Simplify. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/parse.y Modified: head/usr.bin/iscsictl/parse.y ============================================================================== --- head/usr.bin/iscsictl/parse.y Mon Feb 10 15:02:02 2014 (r261712) +++ head/usr.bin/iscsictl/parse.y Mon Feb 10 15:03:08 2014 (r261713) @@ -123,7 +123,7 @@ target_entry: target_name: TARGET_NAME EQUALS STR { if (target->t_name != NULL) - errx(1, "duplicated TargetName at line %d", lineno + 1); + errx(1, "duplicated TargetName at line %d", lineno); target->t_name = $3; } ; @@ -131,7 +131,7 @@ target_name: TARGET_NAME EQUALS STR target_address: TARGET_ADDRESS EQUALS STR { if (target->t_address != NULL) - errx(1, "duplicated TargetAddress at line %d", lineno + 1); + errx(1, "duplicated TargetAddress at line %d", lineno); target->t_address = $3; } ; @@ -139,7 +139,7 @@ target_address: TARGET_ADDRESS EQUALS ST initiator_name: INITIATOR_NAME EQUALS STR { if (target->t_initiator_name != NULL) - errx(1, "duplicated InitiatorName at line %d", lineno + 1); + errx(1, "duplicated InitiatorName at line %d", lineno); target->t_initiator_name = $3; } ; @@ -147,7 +147,7 @@ initiator_name: INITIATOR_NAME EQUALS ST initiator_address: INITIATOR_ADDRESS EQUALS STR { if (target->t_initiator_address != NULL) - errx(1, "duplicated InitiatorAddress at line %d", lineno + 1); + errx(1, "duplicated InitiatorAddress at line %d", lineno); target->t_initiator_address = $3; } ; @@ -155,7 +155,7 @@ initiator_address: INITIATOR_ADDRESS EQU initiator_alias: INITIATOR_ALIAS EQUALS STR { if (target->t_initiator_alias != NULL) - errx(1, "duplicated InitiatorAlias at line %d", lineno + 1); + errx(1, "duplicated InitiatorAlias at line %d", lineno); target->t_initiator_alias = $3; } ; @@ -163,7 +163,7 @@ initiator_alias: INITIATOR_ALIAS EQUALS user: USER EQUALS STR { if (target->t_user != NULL) - errx(1, "duplicated chapIName at line %d", lineno + 1); + errx(1, "duplicated chapIName at line %d", lineno); target->t_user = $3; } ; @@ -171,7 +171,7 @@ user: USER EQUALS STR secret: SECRET EQUALS STR { if (target->t_secret != NULL) - errx(1, "duplicated chapSecret at line %d", lineno + 1); + errx(1, "duplicated chapSecret at line %d", lineno); target->t_secret = $3; } ; @@ -179,7 +179,7 @@ secret: SECRET EQUALS STR mutual_user: MUTUAL_USER EQUALS STR { if (target->t_mutual_user != NULL) - errx(1, "duplicated tgtChapName at line %d", lineno + 1); + errx(1, "duplicated tgtChapName at line %d", lineno); target->t_mutual_user = $3; } ; @@ -187,7 +187,7 @@ mutual_user: MUTUAL_USER EQUALS STR mutual_secret: MUTUAL_SECRET EQUALS STR { if (target->t_mutual_secret != NULL) - errx(1, "duplicated tgtChapSecret at line %d", lineno + 1); + errx(1, "duplicated tgtChapSecret at line %d", lineno); target->t_mutual_secret = $3; } ; @@ -195,76 +195,76 @@ mutual_secret: MUTUAL_SECRET EQUALS STR auth_method: AUTH_METHOD EQUALS STR { if (target->t_auth_method != AUTH_METHOD_UNSPECIFIED) - errx(1, "duplicated AuthMethod at line %d", lineno + 1); + errx(1, "duplicated AuthMethod at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_auth_method = AUTH_METHOD_NONE; else if (strcasecmp($3, "chap") == 0) target->t_auth_method = AUTH_METHOD_CHAP; else errx(1, "invalid AuthMethod at line %d; " - "must be either \"none\" or \"CHAP\"", lineno + 1); + "must be either \"none\" or \"CHAP\"", lineno); } ; header_digest: HEADER_DIGEST EQUALS STR { if (target->t_header_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated HeaderDigest at line %d", lineno + 1); + errx(1, "duplicated HeaderDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_header_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_header_digest = DIGEST_CRC32C; else errx(1, "invalid HeaderDigest at line %d; " - "must be either \"none\" or \"CRC32C\"", lineno + 1); + "must be either \"none\" or \"CRC32C\"", lineno); } ; data_digest: DATA_DIGEST EQUALS STR { if (target->t_data_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated DataDigest at line %d", lineno + 1); + errx(1, "duplicated DataDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_data_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_data_digest = DIGEST_CRC32C; else errx(1, "invalid DataDigest at line %d; " - "must be either \"none\" or \"CRC32C\"", lineno + 1); + "must be either \"none\" or \"CRC32C\"", lineno); } ; session_type: SESSION_TYPE EQUALS STR { if (target->t_session_type != SESSION_TYPE_UNSPECIFIED) - errx(1, "duplicated SessionType at line %d", lineno + 1); + errx(1, "duplicated SessionType at line %d", lineno); if (strcasecmp($3, "normal") == 0) target->t_session_type = SESSION_TYPE_NORMAL; else if (strcasecmp($3, "discovery") == 0) target->t_session_type = SESSION_TYPE_DISCOVERY; else errx(1, "invalid SessionType at line %d; " - "must be either \"normal\" or \"discovery\"", lineno + 1); + "must be either \"normal\" or \"discovery\"", lineno); } ; protocol: PROTOCOL EQUALS STR { if (target->t_protocol != PROTOCOL_UNSPECIFIED) - errx(1, "duplicated protocol at line %d", lineno + 1); + errx(1, "duplicated protocol at line %d", lineno); if (strcasecmp($3, "iscsi") == 0) target->t_protocol = PROTOCOL_ISCSI; else if (strcasecmp($3, "iser") == 0) target->t_protocol = PROTOCOL_ISER; else errx(1, "invalid protocol at line %d; " - "must be either \"iscsi\" or \"iser\"", lineno + 1); + "must be either \"iscsi\" or \"iser\"", lineno); } ; ignored: IGNORED EQUALS STR { - warnx("obsolete statement ignored at line %d", lineno + 1); + warnx("obsolete statement ignored at line %d", lineno); } ; @@ -275,7 +275,7 @@ yyerror(const char *str) { errx(1, "error in configuration file at line %d near '%s': %s", - lineno + 1, yytext, str); + lineno, yytext, str); } static void @@ -318,7 +318,7 @@ conf_new_from_file(const char *path) if (yyin == NULL) err(1, "unable to open configuration file %s", path); check_perms(path); - lineno = 0; + lineno = 1; yyrestart(yyin); error = yyparse(); assert(error == 0);