diff options
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 8b29245..b9c7d1f 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4187,20 +4187,17 @@ void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored) { - FILE *procfile; char buffer[PATH_MAX], fname[PATH_MAX]; - struct cleanup *cleanup; sigemptyset (pending); sigemptyset (blocked); sigemptyset (ignored); xsnprintf (fname, sizeof fname, "/proc/%d/status", pid); - procfile = gdb_fopen_cloexec (fname, "r"); + gdb_file_up procfile = gdb_fopen_cloexec (fname, "r"); if (procfile == NULL) error (_("Could not open %s"), fname); - cleanup = make_cleanup_fclose (procfile); - while (fgets (buffer, PATH_MAX, procfile) != NULL) + while (fgets (buffer, PATH_MAX, procfile.get ()) != NULL) { /* Normal queued signals are on the SigPnd line in the status file. However, 2.6 kernels also have a "shared" pending @@ -4219,8 +4216,6 @@ linux_proc_pending_signals (int pid, sigset_t *pending, else if (startswith (buffer, "SigIgn:\t")) add_line_to_sigset (buffer + 8, ignored); } - - do_cleanups (cleanup); } static enum target_xfer_status |