summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-03-06 11:05:35 +0000
committertrasz <trasz@FreeBSD.org>2014-03-06 11:05:35 +0000
commitb379e28a77b5c26c1bb527f9a1cb8f823d8bebfa (patch)
tree176c3bd60154d3a151637421b63dca2b0ea05965 /usr.bin
parent08122659f6cf3f02bc0958ac282ec874566e326e (diff)
downloadFreeBSD-src-b379e28a77b5c26c1bb527f9a1cb8f823d8bebfa.zip
FreeBSD-src-b379e28a77b5c26c1bb527f9a1cb8f823d8bebfa.tar.gz
MFC r261713:
Simplify. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/iscsictl/parse.y44
1 files changed, 22 insertions, 22 deletions
diff --git a/usr.bin/iscsictl/parse.y b/usr.bin/iscsictl/parse.y
index dc1328f4..b43fb8c 100644
--- a/usr.bin/iscsictl/parse.y
+++ b/usr.bin/iscsictl/parse.y
@@ -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 STR
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 STR
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 EQUALS STR
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 STR
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);
OpenPOWER on IntegriCloud