1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Use snprintf instead of wsprintf, and use getenv("APPDATA") instead of

SHGetFolderPath.

This removes the direct dependency on shell32.dll and user32.dll, which
eats a lot of "desktop heap" for each backend that's started. The
desktop heap is a very limited resource, causing backends to no
longer start once it's been exhausted.

We still have indirect depdendencies on user32.dll through third party
libraries, but those can't easily be removed.

Dave Page
This commit is contained in:
Magnus Hagander
2007-10-23 17:58:01 +00:00
parent 12f25e70a6
commit 344d0cae64
3 changed files with 13 additions and 9 deletions

View File

@ -9,7 +9,7 @@
* signals that the backend can recognize.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/kill.c,v 1.8 2007/01/05 22:20:02 momjian Exp $
* $PostgreSQL: pgsql/src/port/kill.c,v 1.9 2007/10/23 17:58:01 mha Exp $
*
*-------------------------------------------------------------------------
*/
@ -38,7 +38,7 @@ pgkill(int pid, int sig)
errno = EINVAL;
return -1;
}
wsprintf(pipename, "\\\\.\\pipe\\pgsignal_%i", pid);
snprintf(pipename, sizeof(pipename), "\\\\.\\pipe\\pgsignal_%u", pid);
if (!CallNamedPipe(pipename, &sigData, 1, &sigRet, 1, &bytes, 1000))
{
if (GetLastError() == ERROR_FILE_NOT_FOUND)