diff options
author | Peter Eisentraut | 2004-11-09 15:57:57 +0000 |
---|---|---|
committer | Peter Eisentraut | 2004-11-09 15:57:57 +0000 |
commit | e9c05281b5991ad5937cc14579dfff79499d6786 (patch) | |
tree | a03b8a046cf3727660f450f8b538aafa9b4ab63c /src/bin/scripts/common.c | |
parent | 960f545041bc3c6a7536d4ee8328c087c52616b3 (diff) |
Get rid of perror(), substitute some better phrased error messages.
malloc() doesn't set errno, so most uses were buggy anyway.
Diffstat (limited to 'src/bin/scripts/common.c')
-rw-r--r-- | src/bin/scripts/common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index a52b30fec88..8b23d287a01 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.12 2004/10/16 03:10:16 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.13 2004/11/09 15:57:54 petere Exp $ * *------------------------------------------------------------------------- */ @@ -30,7 +30,8 @@ get_user_name(const char *progname) pw = getpwuid(getuid()); if (!pw) { - perror(progname); + fprintf(stderr, _("%s: could not obtain information about current user: %s"), + progname, strerror(errno)); exit(1); } return pw->pw_name; @@ -40,7 +41,8 @@ get_user_name(const char *progname) if (!GetUserName(username, &len)) { - perror(progname); + fprintf(stderr, _("%s: could not get current user name: %s"), + progname, strerror(errno)); exit(1); } return username; |