aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-11-02 13:16:09 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-11-11 15:28:22 -0800
commit7b7b9424d3f94ba5595c4e164b67c0f621146dfe (patch)
tree9d720d5a89ba10ab5f4730178a978a1e1d2f3d5b /gdb/nat
parentfb092e09a21c27cf1d3376de279d1b7e1dabdb3d (diff)
downloadgdb-7b7b9424d3f94ba5595c4e164b67c0f621146dfe.zip
gdb-7b7b9424d3f94ba5595c4e164b67c0f621146dfe.tar.gz
gdb-7b7b9424d3f94ba5595c4e164b67c0f621146dfe.tar.bz2
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
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/linux-osdata.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index 84357e2..ca6acd3 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -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)
{