aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts')
-rw-r--r--src/bin/scripts/Makefile4
-rw-r--r--src/bin/scripts/common.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile
index 48908645e2d..ff51db5e3b6 100644
--- a/src/bin/scripts/Makefile
+++ b/src/bin/scripts/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.22 2003/08/08 04:52:21 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.23 2003/09/07 03:43:55 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb
-override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -DPGSCRIPTS -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
all: submake-libpq submake-backend $(PROGRAMS)
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index dc27a944776..bb191734d45 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/bin/scripts/common.c,v 1.4 2003/08/04 00:43:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/scripts/common.c,v 1.5 2003/09/07 03:43:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,6 +23,7 @@
const char *
get_user_name(const char *progname)
{
+#ifndef WIN32
struct passwd *pw;
pw = getpwuid(getuid());
@@ -32,6 +33,12 @@ get_user_name(const char *progname)
exit(1);
}
return pw->pw_name;
+#else
+ static char username[128]; /* remains after function exit */
+
+ GetUserName(username, sizeof(username)-1);
+ return username;
+#endif
}