/* Low-level file-handling.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 Free Software Foundation, Inc.
This file is part of GDB.
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
bool
mkdir_recursive (const char *dir)
{
- gdb::unique_xmalloc_ptr<char> holder (xstrdup (dir));
+ auto holder = make_unique_xstrdup (dir);
char * const start = holder.get ();
char *component_start = start;
char *component_end = start;