aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2016-06-11 14:50:16 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2016-06-11 14:50:16 -0700
commit850c67606e56e1a47fa0466e127f7b8ceda6ebe3 (patch)
tree0d8f4cf68b0d2792c7e5bcd420fd1d35f6ff3d35 /libio
parentb7a9b7b05b6c5b4da16975065e37d6e0b8401a6c (diff)
downloadglibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.zip
glibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.tar.gz
glibc-850c67606e56e1a47fa0466e127f7b8ceda6ebe3.tar.bz2
2016-06-11 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #19670] [BZ #19672] * io/test-lfs.c (do_prepare): Use xmalloc. * io/tst-fcntl.c (do_prepare): Likewise. * libio/tst-fopenloc.c (do_bz17916): Likewise. * libio/tst-mmap2-eofsync.c (do_prepare): Likewise. * posix/tst-exec.c (do_prepare): Likewise. * posix/tst-pathconf.c (prepare): Likewise. * posix/tst-spawn.c (do_prepare): Likewise. * posix/tst-truncate.c (do_prepare): Likewise. * rt/tst-aio.c (do_prepare): Likewise.
Diffstat (limited to 'libio')
-rw-r--r--libio/tst-fopenloc.c11
-rw-r--r--libio/tst-mmap2-eofsync.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c
index 0f7edb6..63ac540 100644
--- a/libio/tst-fopenloc.c
+++ b/libio/tst-fopenloc.c
@@ -26,9 +26,13 @@
#include <wchar.h>
#include <sys/resource.h>
-
static const char inputfile[] = "../iconvdata/testdata/ISO-8859-1";
+static int do_test(void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int
do_bz17916 (void)
{
@@ -39,7 +43,7 @@ do_bz17916 (void)
setrlimit (RLIMIT_STACK, &rl);
const size_t sz = 2 * 1024 * 1024;
- char *ccs = malloc (sz);
+ char *ccs = xmalloc (sz);
strcpy (ccs, "r,ccs=");
memset (ccs + 6, 'A', sz - 6 - 1);
ccs[sz - 1] = '\0';
@@ -85,6 +89,3 @@ do_test (void)
return do_bz17916 ();
}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/libio/tst-mmap2-eofsync.c b/libio/tst-mmap2-eofsync.c
index f369965..05dedb8 100644
--- a/libio/tst-mmap2-eofsync.c
+++ b/libio/tst-mmap2-eofsync.c
@@ -20,7 +20,7 @@ static char *pages;
static void
do_prepare (void)
{
- pages = malloc (getpagesize () * 2);
+ pages = xmalloc (getpagesize () * 2);
memset (pages, 'a', getpagesize ());
memset (pages + getpagesize (), 'b', getpagesize ());