diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-09-07 03:43:57 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-09-07 03:43:57 +0000 |
commit | 4b407f6c3cd7584c308fcd75fd8d2a094a4e8dd1 (patch) | |
tree | cf14f1a883879e481b944acf5159c54ed3dab9a4 /src/bin/scripts/common.c | |
parent | 7703e55c32e82e2485272596ec5ee6ac1695e42d (diff) |
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)
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r-- | src/bin/scripts/common.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 } |