Commit 6bb9d301 authored by Robert Haas's avatar Robert Haas

Fix compiler warning.

get_user_name returns const char *, but we were assigning the result
to a char * variable.
parent 001a573a
...@@ -443,7 +443,7 @@ void check_pghost_envvar(void); ...@@ -443,7 +443,7 @@ void check_pghost_envvar(void);
/* util.c */ /* util.c */
char *quote_identifier(const char *s); char *quote_identifier(const char *s);
int get_user_info(char **user_name); int get_user_info(char **user_name_p);
void check_ok(void); void check_ok(void);
void void
report_status(eLogType type, const char *fmt,...) report_status(eLogType type, const char *fmt,...)
......
...@@ -205,9 +205,10 @@ quote_identifier(const char *s) ...@@ -205,9 +205,10 @@ quote_identifier(const char *s)
* get_user_info() * get_user_info()
*/ */
int int
get_user_info(char **user_name) get_user_info(char **user_name_p)
{ {
int user_id; int user_id;
const char *user_name;
char *errstr; char *errstr;
#ifndef WIN32 #ifndef WIN32
...@@ -216,12 +217,12 @@ get_user_info(char **user_name) ...@@ -216,12 +217,12 @@ get_user_info(char **user_name)
user_id = 1; user_id = 1;
#endif #endif
*user_name = get_user_name(&errstr); user_name = get_user_name(&errstr);
if (!*user_name) if (!user_name)
pg_fatal("%s\n", errstr); pg_fatal("%s\n", errstr);
/* make a copy */ /* make a copy */
*user_name = pg_strdup(*user_name); *user_name_p = pg_strdup(user_name);
return user_id; return user_id;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment