X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fclean-temp.c;h=7acc68857dc529aee1302506f60a9598fd71302c;hb=bbdcfead98c6d3536215c3f0f603e4f92a28d26b;hp=97b26008f957d844f717725af1521cb85b8fb42c;hpb=20668199737bb0bf121381fa0ffa197f0aafcfd1;p=gnulib.git diff --git a/lib/clean-temp.c b/lib/clean-temp.c index 97b26008f..7acc68857 100644 --- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -67,6 +67,13 @@ # define uintptr_t unsigned long #endif +#if !GNULIB_FCNTL_SAFER +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +# undef open +# undef close +#endif + /* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5)) ensure that while constructing or modifying the data structures, the field @@ -273,8 +280,7 @@ create_temp_dir (const char *prefix, const char *parentdir, size_t old_allocated = cleanup_list.tempdir_allocated; size_t new_allocated = 2 * cleanup_list.tempdir_allocated + 1; struct tempdir * volatile *new_array = - (struct tempdir * volatile *) - xmalloc (new_allocated * sizeof (struct tempdir * volatile)); + XNMALLOC (new_allocated, struct tempdir * volatile); if (old_allocated == 0) /* First use of this facility. Register the cleanup handler. */ @@ -306,7 +312,7 @@ create_temp_dir (const char *prefix, const char *parentdir, } /* Initialize a 'struct tempdir'. */ - tmpdir = (struct tempdir *) xmalloc (sizeof (struct tempdir)); + tmpdir = XMALLOC (struct tempdir); tmpdir->dirname = NULL; tmpdir->cleanup_verbose = cleanup_verbose; tmpdir->subdirs = gl_list_create_empty (GL_LINKEDHASH_LIST,