Use getpwuid_r instead of getpwuid

gdb/ChangeLog:

2019-11-11  Christian Biesinger  <cbiesinger@google.com>

	* nat/linux-osdata.c (user_from_uid): Use getpwuid_r.

Change-Id: I587359267f8963ef1da6ba0223a1525807a721de
This commit is contained in:
Christian Biesinger 2019-11-02 13:16:09 -05:00
parent fb092e09a2
commit 7b7b9424d3
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2019-11-11 Christian Biesinger <cbiesinger@google.com>
* nat/linux-osdata.c (user_from_uid): Use getpwuid_r.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* python/py-symbol.c (gdbpy_lookup_static_symbols): New

View File

@ -205,7 +205,10 @@ commandline_from_pid (PID_T pid)
static void
user_from_uid (char *user, int maxlen, uid_t uid)
{
struct passwd *pwentry = getpwuid (uid);
struct passwd *pwentry;
char buf[1024];
struct passwd pwd;
getpwuid_r (uid, &pwd, buf, sizeof (buf), &pwentry);
if (pwentry)
{