projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mark 'memcpy' obsolete.
[gnulib.git]
/
lib
/
clean-temp.c
diff --git
a/lib/clean-temp.c
b/lib/clean-temp.c
index
823a932
..
283d8af
100644
(file)
--- a/
lib/clean-temp.c
+++ b/
lib/clean-temp.c
@@
-2,10
+2,10
@@
Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
- This program is free software
;
you can redistribute it and/or modify
+ This program is free software
:
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2, or (at your option)
- any later version.
+ the Free Software Foundation; either version
3 of the License, or
+
(at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-13,8
+13,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <config.h>
@@
-40,7
+39,7
@@
#include "pathmax.h"
#include "tmpdir.h"
#include "xalloc.h"
#include "pathmax.h"
#include "tmpdir.h"
#include "xalloc.h"
-#include "x
allocs
a.h"
+#include "x
malloc
a.h"
#include "gl_linkedhash_list.h"
#include "gettext.h"
#if GNULIB_FWRITEERROR
#include "gl_linkedhash_list.h"
#include "gettext.h"
#if GNULIB_FWRITEERROR
@@
-320,12
+319,14
@@
create_temp_dir (const char *prefix, const char *parentdir,
tmpdir->dirname = NULL;
tmpdir->cleanup_verbose = cleanup_verbose;
tmpdir->subdirs = gl_list_create_empty (GL_LINKEDHASH_LIST,
tmpdir->dirname = NULL;
tmpdir->cleanup_verbose = cleanup_verbose;
tmpdir->subdirs = gl_list_create_empty (GL_LINKEDHASH_LIST,
- string_equals, string_hash, false);
+ string_equals, string_hash, NULL,
+ false);
tmpdir->files = gl_list_create_empty (GL_LINKEDHASH_LIST,
tmpdir->files = gl_list_create_empty (GL_LINKEDHASH_LIST,
- string_equals, string_hash, false);
+ string_equals, string_hash, NULL,
+ false);
/* Create the temporary directory. */
/* Create the temporary directory. */
- xtemplate = (char *) x
allocs
a (PATH_MAX);
+ xtemplate = (char *) x
malloc
a (PATH_MAX);
if (path_search (xtemplate, PATH_MAX, parentdir, prefix, parentdir == NULL))
{
error (0, errno,
if (path_search (xtemplate, PATH_MAX, parentdir, prefix, parentdir == NULL))
{
error (0, errno,
@@
-352,11
+353,11
@@
create_temp_dir (const char *prefix, const char *parentdir,
block because then the cleanup handler would not remove the directory
if xstrdup fails. */
tmpdir->dirname = xstrdup (tmpdirname);
block because then the cleanup handler would not remove the directory
if xstrdup fails. */
tmpdir->dirname = xstrdup (tmpdirname);
- free
s
a (xtemplate);
+ freea (xtemplate);
return (struct temp_dir *) tmpdir;
quit:
return (struct temp_dir *) tmpdir;
quit:
- free
s
a (xtemplate);
+ freea (xtemplate);
return NULL;
}
return NULL;
}
@@
-599,7
+600,8
@@
static void
register_fd (int fd)
{
if (descriptors == NULL)
register_fd (int fd)
{
if (descriptors == NULL)
- descriptors = gl_list_create_empty (GL_LINKEDHASH_LIST, NULL, NULL, false);
+ descriptors = gl_list_create_empty (GL_LINKEDHASH_LIST, NULL, NULL, NULL,
+ false);
gl_list_add_first (descriptors, (void *) (uintptr_t) fd);
}
gl_list_add_first (descriptors, (void *) (uintptr_t) fd);
}
@@
-662,14
+664,14
@@
fopen_temp (const char *file_name, const char *mode)
if (supports_delete_on_close ())
{
size_t mode_len = strlen (mode);
if (supports_delete_on_close ())
{
size_t mode_len = strlen (mode);
- char *augmented_mode = (char *) x
allocs
a (mode_len + 2);
+ char *augmented_mode = (char *) x
malloc
a (mode_len + 2);
memcpy (augmented_mode, mode, mode_len);
memcpy (augmented_mode + mode_len, "D", 2);
fp = fopen (file_name, augmented_mode);
saved_errno = errno;
memcpy (augmented_mode, mode, mode_len);
memcpy (augmented_mode + mode_len, "D", 2);
fp = fopen (file_name, augmented_mode);
saved_errno = errno;
- free
s
a (augmented_mode);
+ freea (augmented_mode);
}
else
#endif
}
else
#endif