bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

realpath on AIX 7.1


From: Bruno Haible
Subject: realpath on AIX 7.1
Date: Sun, 5 Jun 2011 17:27:32 +0200
User-agent: KMail/1.9.9

Hi Eric,

On AIX 7.1 I'm seeing this test failure:

  test-canonicalize-lgpl.c:69: assertion failed
  FAIL: test-canonicalize-lgpl

The reason is apparently a bug in realpath. Here's a test case:

================================================================================
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
  char *result;

  result = realpath ("conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", 
errno);

  result = realpath ("conftest.dir//.", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir//./..", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir/./../conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir//./../conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  return 0;
}
================================================================================
$ gcc -D_ALL_SOURCE foo.c -Wall
Output:
/home/haible/testdir1/gltests/conftest.dir
/home/haible/testdir1/gltests/conftest.dir/
/home/haible/testdir1/gltests/conftest.dir
/home/haible/testdir1/gltests/conftest.dir
errno=2

Do you think we should work around it?

Bruno
-- 
In memoriam Eduard Lederer <http://de.wikipedia.org/wiki/Eduard_Lederer>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]