xstrdup is too dangerous to use in a syscall replacement.
* modules/mkdir (Depends-on): Drop xalloc.
* lib/mkdir.c (rpl_mkdir): Fail with ENOMEM rather than calling
exit.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-10-29 Eric Blake <ebb9@byu.net>
+ mkdir: make safe for libraries
+ * modules/mkdir (Depends-on): Drop xalloc.
+ * lib/mkdir.c (rpl_mkdir): Fail with ENOMEM rather than calling
+ exit.
+
tests: avoid some compiler warnings
* tests/test-getaddrinfo.c (simple): Mark static, and allow string
literals.
if (len && dir[len - 1] == '/')
{
- tmp_dir = xstrdup (dir);
+ tmp_dir = strdup (dir);
+ if (!tmp_dir)
+ {
+ /* Rather than rely on strdup-posix, we set errno ourselves. */
+ errno = ENOMEM;
+ return -1;
+ }
strip_trailing_slashes (tmp_dir);
}
else
Depends-on:
sys_stat
-xalloc
dirname
configure.ac: