From 4b407f6c3cd7584c308fcd75fd8d2a094a4e8dd1 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 7 Sep 2003 03:43:57 +0000 Subject: Changes for MinGW/WIN32: o allow configure to see include/port/win32 include files o add matching Win32 accept() prototype o allow pg_id to compile with native Win32 API o fix invalide mbvalidate() function calls (existing bug) o allow /scripts to compile with native Win32 API o add win32.c to Win32 compiles (already in *.mak files) --- src/bin/scripts/common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/bin/scripts/common.c') 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 } -- cgit v1.2.3