From 6cceac94147f6026e93dcfc0a0df03555b571a12 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 24 Jan 2019 06:43:45 -0700 Subject: Remove last cleanup from linux-namespaces.c This removes the last cleanup from linux-namespaces.c, replacing it with a use of SCOPE_EXIT. 2019-03-06 Tom Tromey * nat/linux-namespaces.c (linux_mntns_access_fs): Use SCOPE_EXIT. * common/filestuff.h (make_cleanup_close): Don't declare. * common/filestuff.c (do_close_cleanup, make_cleanup_close): Remove. --- gdb/common/filestuff.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'gdb/common/filestuff.c') diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index 0d2fa8d..1ca6248 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -426,27 +426,6 @@ gdb_pipe_cloexec (int filedes[2]) return result; } -/* Helper function which does the work for make_cleanup_close. */ - -static void -do_close_cleanup (void *arg) -{ - int *fd = (int *) arg; - - close (*fd); -} - -/* See filestuff.h. */ - -struct cleanup * -make_cleanup_close (int fd) -{ - int *saved_fd = XNEW (int); - - *saved_fd = fd; - return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree); -} - /* See common/filestuff.h. */ bool -- cgit v1.1