bug-gnulib
[Top][All Lists]
Advanced

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

Re: link-follow and mingw


From: Eric Blake
Subject: Re: link-follow and mingw
Date: Tue, 22 Sep 2009 06:29:36 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/4/2009 11:58 AM:
> Unfortunately, I don't have linkat working yet

Still true, but here's another piece of the puzzle.

fcntl_h.m4 created a symlink conftest.sym, but never cleaned it up; as a
result, an ill-timed link-follow.m4 failed to create a symlink by the same
name and was aborting, and assuming incorrectly that Linux link() follows
symlinks.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4wzAACgkQ84KuGfSFAYDlJQCg2VToru/LBjOUiW25ToR5SgEn
TAQAnAzl9fRPqOZWuy02uxA/mVB5jRu7
=XpS7
-----END PGP SIGNATURE-----
>From da5d03a925021685437c7e574458f66fbe56bd37 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 22 Sep 2009 06:24:25 -0600
Subject: [PATCH] link-follow: ensure correct result

* m4/fcntl_h.m4 (gl_FCNTL_H): Clean up temporary file.
* m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Distinguish
between possible failures.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    7 +++++++
 m4/fcntl_h.m4     |    3 ++-
 m4/link-follow.m4 |   10 +++++-----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f275dd..d80af61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-22  Eric Blake  <address@hidden>
+
+       link-follow: ensure correct result
+       * m4/fcntl_h.m4 (gl_FCNTL_H): Clean up temporary file.
+       * m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Distinguish
+       between possible failures.
+
 2009-09-21  Eric Blake  <address@hidden>

        open, openat: minor optimization
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 5eed088..118a4fa 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,4 +1,4 @@
-# serial 4
+# serial 5
 # Configure fcntl.h.
 dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -38,6 +38,7 @@ AC_DEFUN([gl_FCNTL_H],
              if (symlink (".", sym) != 0
                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
                status |= 32;
+             unlink (sym);
            }
            {
              static char const file[] = "confdefs.h";
diff --git a/m4/link-follow.m4 b/m4/link-follow.m4
index 48885ea..2043670 100644
--- a/m4/link-follow.m4
+++ b/m4/link-follow.m4
@@ -1,4 +1,4 @@
-# serial 14
+# serial 15
 dnl Run a program to determine whether link(2) follows symlinks.
 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.

@@ -47,16 +47,16 @@ AC_DEFUN([gl_FUNC_LINK_FOLLOWS_SYMLINK],

          /* Create a symlink to the regular file. */
          if (symlink (file, sym))
-           abort ();
+           return 2;

          /* Create a hard link to that symlink.  */
          if (link (sym, hard))
-           abort ();
+           return 3;

          if (lstat (hard, &sb_hard))
-           abort ();
+           return 4;
          if (lstat (file, &sb_file))
-           abort ();
+           return 5;

          /* If the dev/inode of hard and file are the same, then
             the link call followed the symlink.  */
-- 
1.6.5.rc1


reply via email to

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