fsync test: Avoid test failure on MacOS X and AIX.
[pspp] / tests / test-linkat.c
index 1f73544706ec99c70b792963d446c676a20a819b..2bf17905243af3f4cd2e543f6bb8b064d444fc45 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of linkat.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -34,7 +34,6 @@ SIGNATURE_CHECK (linkat, int, (int, char const *, int, char const *, int));
 #include "areadlink.h"
 #include "filenamecat.h"
 #include "same-inode.h"
-#include "xgetcwd.h"
 #include "ignore-value.h"
 #include "macros.h"
 
@@ -119,7 +118,8 @@ main (void)
   ASSERT (mkdir (BASE "sub1", 0700) == 0);
   ASSERT (mkdir (BASE "sub2", 0700) == 0);
   ASSERT (close (creat (BASE "00", 0600)) == 0);
-  cwd = xgetcwd ();
+  cwd = getcwd (NULL, 0);
+  ASSERT (cwd);
 
   dfd = open (BASE "sub1", O_RDONLY);
   ASSERT (0 <= dfd);
@@ -140,9 +140,11 @@ main (void)
   for (i = 0; i < 32; i++)
     {
       int fd1 = (i & 8) ? dfd : AT_FDCWD;
-      char *file1 = file_name_concat ((i & 4) ? ".." : cwd, BASE "xx", NULL);
+      char *file1 = mfile_name_concat ((i & 4) ? ".." : cwd, BASE "xx", NULL);
       int fd2 = (i & 2) ? dfd : AT_FDCWD;
-      char *file2 = file_name_concat ((i & 1) ? ".." : cwd, BASE "xx", NULL);
+      char *file2 = mfile_name_concat ((i & 1) ? ".." : cwd, BASE "xx", NULL);
+      ASSERT (file1);
+      ASSERT (file2);
       flag = (i & 0x10 ? AT_SYMLINK_FOLLOW : 0);
 
       ASSERT (sprintf (strchr (file1, '\0') - 2, "%02d", i) == 2);