git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0a94d8)
pg_regress: Remove unused variable
Thu, 6 Jul 2023 19:21:37 +0000 (21:21 +0200)
Thu, 6 Jul 2023 19:21:37 +0000 (21:21 +0200)
The restrictedToken handle was set but never read, so remove the
variable and change to a boolean style check to match other uses
of CreateRestrictedProcess().

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/62A63C81-3893-4E3F-A34E-2081DF67074E@yesql.se


diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 3e4fd918dd8dc738454f300dbc486f50c3de12e4..b68632320a72597ae4996b820b756e742c1b9708 100644 (file)
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1226,7 +1226,6 @@ spawn_process(const char *cmdline)
#else
PROCESS_INFORMATION pi;
char *cmdline2;
- HANDLE restrictedToken;
const char *comspec;
/* Find CMD.EXE location using COMSPEC, if it's set */
@@ -1237,8 +1236,7 @@ spawn_process(const char *cmdline)
memset(&pi, 0, sizeof(pi));
cmdline2 = psprintf("\"%s\" /c \"%s\"", comspec, cmdline);
- if ((restrictedToken =
- CreateRestrictedProcess(cmdline2, &pi)) == 0)
+ if (!CreateRestrictedProcess(cmdline2, &pi))
exit(2);
CloseHandle(pi.hThread);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /