bug-gnulib
[Top][All Lists]
Advanced

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

Re: linkat test on AIX 7.1BETA


From: Bruno Haible
Subject: Re: linkat test on AIX 7.1BETA
Date: Sat, 31 Jul 2010 13:04:44 +0200
User-agent: KMail/1.9.9

Hello Rainer,

> >   test-link.h:117: assertion failed
> >   FAIL: test-linkat
> test_link(func = 0x200009a0, print = 1), line 117 in "test-link.h"
> main(), line 89 in "test-linkat.c"
> ...
> There is a second trap:
> 
> ASSERT (func (BASE "a", BASE "c/") == -1);
> 
> I have checked the return of func(), its 0.

Can you please show the output of this test program? If it's as expected,
I'll turn it into an autoconf test.

===============================================================================
#define _GNU_SOURCE 1
#define _ALL_SOURCE 1
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>

int main ()
{
  int fd;
  int err;
  int ret;

  /* Ensure a clean working area.  */
  unlink ("conftesta");
  unlink ("conftestb");
  unlink ("conftestc");
  unlink ("conftestd");

  /* Create a regular file.  */
  fd = open ("conftesta", O_CREAT | O_EXCL | O_WRONLY, 0600);
  if (fd < 0)
    return 1;
  if (write (fd, "hello", 5) < 5)
    return 2;
  if (close (fd) < 0)
    return 3;
  /* Test whether hard links are supported on the current device.  */
  if (linkat (AT_FDCWD, "conftesta", AT_FDCWD, "conftestb", AT_SYMLINK_FOLLOW) 
< 0)
    return 0;
  /* Test whether a trailing "/" is treated like "/.".  */
  ret = linkat (AT_FDCWD, "conftesta/", AT_FDCWD, "conftestc", 
AT_SYMLINK_FOLLOW);
  err = errno;
  fprintf (stderr, "ret = %d\n", ret);
  if (ret < 0)
    {
      fprintf (stderr, "errno = %d\n", err);
      errno = err;
      perror ("");
    }
  ret = linkat (AT_FDCWD, "conftesta", AT_FDCWD, "conftestd/", 
AT_SYMLINK_FOLLOW);
  err = errno;
  fprintf (stderr, "ret = %d\n", ret);
  if (ret < 0)
    {
      fprintf (stderr, "errno = %d\n", err);
      errno = err;
      perror ("");
    }

  return 0;
}
===============================================================================

Bruno



reply via email to

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