Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: gdb/common/linux-procfs.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/common/linux-procfs.h ('k') | gdb/common/linux-ptrace.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/common/linux-procfs.c
diff --git a/gdb/common/linux-procfs.c b/gdb/common/linux-procfs.c
index a5aa8305f7d855c4aca2c41f6ebbe4ac23aee51d..ec0f6c72fa00259ffcf5be27696c0b0a1c6e3b75 100644
--- a/gdb/common/linux-procfs.c
+++ b/gdb/common/linux-procfs.c
@@ -1,5 +1,5 @@
/* Linux-specific PROCFS manipulation routines.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -20,10 +20,11 @@
#include "server.h"
#else
#include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
#endif
#include "linux-procfs.h"
+#include "filestuff.h"
/* Return the TGID of LWPID from /proc/pid/status. Returns -1 if not
found. */
@@ -37,7 +38,7 @@ linux_proc_get_int (pid_t lwpid, const char *field)
int retval = -1;
snprintf (buf, sizeof (buf), "/proc/%d/status", (int) lwpid);
- status_file = fopen (buf, "r");
+ status_file = gdb_fopen_cloexec (buf, "r");
if (status_file == NULL)
{
warning (_("unable to open /proc file '%s'"), buf);
@@ -83,7 +84,7 @@ linux_proc_pid_has_state (pid_t pid, const char *state)
int have_state;
xsnprintf (buffer, sizeof (buffer), "/proc/%d/status", (int) pid);
- procfile = fopen (buffer, "r");
+ procfile = gdb_fopen_cloexec (buffer, "r");
if (procfile == NULL)
{
warning (_("unable to open /proc file '%s'"), buffer);
« no previous file with comments | « gdb/common/linux-procfs.h ('k') | gdb/common/linux-ptrace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698