summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
Diffstat (limited to 'src/port')
-rw-r--r--src/port/kill.c4
-rw-r--r--src/port/path.c14
2 files changed, 11 insertions, 7 deletions
diff --git a/src/port/kill.c b/src/port/kill.c
index 12d5dec456..d097051bae 100644
--- a/src/port/kill.c
+++ b/src/port/kill.c
@@ -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)
diff --git a/src/port/path.c b/src/port/path.c
index 10307d0988..c43843bb46 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.71 2007/01/05 22:20:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.72 2007/10/23 17:58:01 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -628,10 +628,14 @@ get_home_path(char *ret_path)
strlcpy(ret_path, pwd->pw_dir, MAXPGPATH);
return true;
#else
- char tmppath[MAX_PATH];
-
- ZeroMemory(tmppath, sizeof(tmppath));
- if (SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, tmppath) != S_OK)
+ char *tmppath;
+
+ /*
+ * Note: We use getenv here because the more modern SHGetSpecialFolderPath()
+ * will force us to link with shell32.lib which eats valuable desktop heap.
+ */
+ tmppath = getenv("APPDATA");
+ if (!tmppath)
return false;
snprintf(ret_path, MAXPGPATH, "%s/postgresql", tmppath);
return true;