X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=posix%2Ftst-execvp2.c;h=f6c0cb4d989a965b003691ca2ce67a59350812e3;hb=8c4f69d711481a18c70cb9a6c0a5367604894320;hp=440dfab4389b35418b8520e6ce304c1bccb0186c;hpb=7d421209287a07db5e926552ae5fbe9d8abb50dc;p=platform%2Fupstream%2Fglibc.git diff --git a/posix/tst-execvp2.c b/posix/tst-execvp2.c index 440dfab..f6c0cb4 100644 --- a/posix/tst-execvp2.c +++ b/posix/tst-execvp2.c @@ -25,12 +25,8 @@ prepare (int argc, char *argv[]) { char *buf; int off; - asprintf (&buf, "cp %s %n%s-copy", argv[0], &off, argv[0]); - if (buf == NULL) - { - puts ("asprintf failed"); - exit (1); - } + + buf = xasprintf ("cp %s %n%s-copy", argv[0], &off, argv[0]); if (system (buf) != 0) { puts ("system failed"); @@ -61,13 +57,8 @@ do_test (void) puts ("canonicalize_file_name failed"); return 1; } - char *path; - asprintf (&path, "%s:../libio:../elf", bindir); - if (path == NULL) - { - puts ("asprintf failed"); - return 1; - } + + char *path = xasprintf ("%s:../libio:../elf", bindir); setenv ("PATH", path, 1);