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 <[email protected]>Reviewed-by: Michael Paquier <[email protected]>Discussion: https://postgr.es/m/
62A63C81-3893-4E3F-A34E-
2081DF67074E@yesql.se
#else
PROCESS_INFORMATION pi;
char *cmdline2;
- HANDLE restrictedToken;
const char *comspec;
/* Find CMD.EXE location using COMSPEC, if it's set */
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);