+2015-06-10 Gary Benson <gbenson@redhat.com>
+
+ * utils.h (make_cleanup_close): Moved to common/filestuff.h.
+ * utils.c (do_close_cleanup): Moved to common/filestuff.c.
+ (make_cleanup_close): Likewise.
+ * common/filestuff.h (make_cleanup_close): Moved from utils.h.
+ * common/filestuff.c (do_close_cleanup): Moved from utils.c.
+ (make_cleanup_close): Likewise.
+
2015-06-03 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (thread_rec): Also ignore ERROR_INVALID_HANDLE
return result;
}
+
+/* Helper function which does the work for make_cleanup_close. */
+
+static void
+do_close_cleanup (void *arg)
+{
+ int *fd = arg;
+
+ close (*fd);
+}
+
+/* See cleanup-utils.h. */
+
+struct cleanup *
+make_cleanup_close (int fd)
+{
+ int *saved_fd = xmalloc (sizeof (fd));
+
+ *saved_fd = fd;
+ return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
+}
extern int gdb_pipe_cloexec (int filedes[2]);
+/* Return a new cleanup that closes FD. */
+
+extern struct cleanup *make_cleanup_close (int fd);
+
#endif /* FILESTUFF_H */
return make_cleanup (do_bfd_close_cleanup, abfd);
}
-static void
-do_close_cleanup (void *arg)
-{
- int *fd = arg;
-
- close (*fd);
-}
-
-struct cleanup *
-make_cleanup_close (int fd)
-{
- int *saved_fd = xmalloc (sizeof (fd));
-
- *saved_fd = fd;
- return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
-}
-
/* Helper function which does the work for make_cleanup_fclose. */
static void
extern struct cleanup *(make_cleanup_free_section_addr_info
(struct section_addr_info *));
-extern struct cleanup *make_cleanup_close (int fd);
+/* For make_cleanup_close see common/filestuff.h. */
extern struct cleanup *make_cleanup_fclose (FILE *file);