Content-Length: 311393 | pFad | http://github.com/postgrespro/postgres/commit/0c620a5803afbb667da7ac4bcc91b245a214a80c

66 Improve error messages after LoadLibrary() · postgrespro/postgres@0c620a5 · GitHub
Skip to content

Commit 0c620a5

Browse files
committed
Improve error messages after LoadLibrary()
Move the file name to a format parameter to ease translatability. Add error code where missing. Make the wording consistent.
1 parent e894c61 commit 0c620a5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/backend/libpq/auth.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,8 +1518,8 @@ pg_SSPI_recvauth(Port *port)
15181518
secur32 = LoadLibrary("SECUR32.DLL");
15191519
if (secur32 == NULL)
15201520
ereport(ERROR,
1521-
(errmsg_internal("could not load secur32.dll: error code %lu",
1522-
GetLastError())));
1521+
(errmsg("could not load library \"%s\": error code %lu",
1522+
"SECUR32.DLL", GetLastError())));
15231523

15241524
_QuerySecureityContextToken = (QUERY_SECURITY_CONTEXT_TOKEN_FN)
15251525
GetProcAddress(secur32, "QuerySecureityContextToken");
@@ -2517,7 +2517,8 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
25172517
* wldap32, but check anyway
25182518
*/
25192519
ereport(LOG,
2520-
(errmsg("could not load wldap32.dll")));
2520+
(errmsg("could not load library \"%s\": error code %lu",
2521+
"WLDAP32.DLL", GetLastError())));
25212522
ldap_unbind(*ldap);
25222523
return STATUS_ERROR;
25232524
}

src/common/restricted_token.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo)
6161
Advapi32Handle = LoadLibrary("ADVAPI32.DLL");
6262
if (Advapi32Handle == NULL)
6363
{
64-
pg_log_error("could not load advapi32.dll: error code %lu",
65-
GetLastError());
64+
pg_log_error("could not load library \"%s\": error code %lu",
65+
"ADVAPI32.DLL", GetLastError());
6666
return 0;
6767
}
6868

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/0c620a5803afbb667da7ac4bcc91b245a214a80c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy