diff options
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r-- | src/bin/scripts/common.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index 4645bc137f9..e57e5207c6b 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -14,7 +14,6 @@ #include "postgres_fe.h" -#include <pwd.h> #include <signal.h> #include <unistd.h> @@ -30,38 +29,6 @@ static CRITICAL_SECTION cancelConnLock; #endif /* - * Returns the current user name. - */ -const char * -get_user_name(const char *progname) -{ -#ifndef WIN32 - struct passwd *pw; - - pw = getpwuid(geteuid()); - if (!pw) - { - fprintf(stderr, _("%s: could not obtain information about current user: %s\n"), - progname, strerror(errno)); - exit(1); - } - return pw->pw_name; -#else - static char username[128]; /* remains after function exit */ - DWORD len = sizeof(username) - 1; - - if (!GetUserName(username, &len)) - { - fprintf(stderr, _("%s: could not get current user name: %s\n"), - progname, strerror(errno)); - exit(1); - } - return username; -#endif -} - - -/* * Provide strictly harmonized handling of --help and --version * options. */ |