Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ca5aa6

Browse files
committed
Replace now unnecessary goto statements by using return directly.
1 parentbb8c822 commit3ca5aa6

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

‎src/backend/libpq/hba.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.169 2008/10/23 13:31:10 mha Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.170 2008/10/24 12:48:31 mha Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -581,7 +581,7 @@ check_db(const char *dbname, const char *role, char *param_str)
581581
optname, validmethods), \
582582
errcontext("line %d of configuration file \"%s\"", \
583583
line_num, HbaFileName))); \
584-
goto hba_other_error; \
584+
return false; \
585585
} while (0);
586586

587587
#defineREQUIRE_AUTH_OPTION(methodval,optname,validmethods) do {\
@@ -597,7 +597,7 @@ check_db(const char *dbname, const char *role, char *param_str)
597597
authname, argname), \
598598
errcontext("line %d of configuration file \"%s\"", \
599599
line_num, HbaFileName))); \
600-
goto hba_other_error; \
600+
return false; \
601601
} \
602602
} while (0);
603603

@@ -704,7 +704,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
704704
*cidr_slash='/';
705705
if (gai_result)
706706
pg_freeaddrinfo_all(hints.ai_family,gai_result);
707-
gotohba_other_error;
707+
return false;
708708
}
709709

710710
if (cidr_slash)
@@ -739,7 +739,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
739739
line_num,HbaFileName)));
740740
if (gai_result)
741741
pg_freeaddrinfo_all(hints.ai_family,gai_result);
742-
gotohba_other_error;
742+
return false;
743743
}
744744

745745
memcpy(&parsedline->mask,gai_result->ai_addr,gai_result->ai_addrlen);
@@ -751,7 +751,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
751751
(errcode(ERRCODE_CONFIG_FILE_ERROR),
752752
errmsg("IP address and mask do not match in file \"%s\" line %d",
753753
HbaFileName,line_num)));
754-
gotohba_other_error;
754+
return false;
755755
}
756756
}
757757
}/* != ctLocal */
@@ -813,7 +813,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
813813
token),
814814
errcontext("line %d of configuration file \"%s\"",
815815
line_num,HbaFileName)));
816-
gotohba_other_error;
816+
return false;
817817
}
818818

819819
if (unsupauth)
@@ -824,7 +824,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
824824
token),
825825
errcontext("line %d of configuration file \"%s\"",
826826
line_num,HbaFileName)));
827-
gotohba_other_error;
827+
return false;
828828
}
829829

830830
/* Invalid authentication combinations */
@@ -836,7 +836,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
836836
errmsg("krb5 authentication is not supported on local sockets"),
837837
errcontext("line %d of configuration file \"%s\"",
838838
line_num,HbaFileName)));
839-
gotohba_other_error;
839+
return false;
840840
}
841841

842842
/* Parse remaining arguments */
@@ -859,7 +859,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
859859
errmsg("authentication option not in name=value format: %s",token),
860860
errcontext("line %d of configuration file \"%s\"",
861861
line_num,HbaFileName)));
862-
gotohba_other_error;
862+
return false;
863863
}
864864
else
865865
{
@@ -902,7 +902,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
902902
errmsg("invalid ldap port '%s'",c),
903903
errcontext("line %d of configuration file \"%s\"",
904904
line_num,HbaFileName)));
905-
gotohba_other_error;
905+
return false;
906906
}
907907
}
908908
elseif (strcmp(token,"ldapprefix")==0)
@@ -922,7 +922,7 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
922922
errmsg("unknown authentication option name '%s'",token),
923923
errcontext("line %d of configuration file \"%s\"",
924924
line_num,HbaFileName)));
925-
gotohba_other_error;
925+
return false;
926926
}
927927
}
928928
}
@@ -953,8 +953,6 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
953953
errcontext("line %d of configuration file \"%s\"",
954954
line_num,HbaFileName)));
955955

956-
/* Come here if suitable message already logged */
957-
hba_other_error:
958956
return false;
959957
}
960958

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp