This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: lockfile & link on Core Duo laptop


Benjamin D wrote:
Hi!

I've been using cygwin for a long time on my notebooks and desktops. I
recently got a Core Duo for work. Most things seem to work fine, but
lockfie didn't. I got the helpful error message:
  lockfile foo
  lockfile: Try praying, giving up on "foo"

So, I downloaded the source and traced where the error was occuring.
It's happening at a call to link(2):

#include <unistd.h>

int link(const char *oldpath, const char *newpath);

Which is returning errno:
       ENOENT A directory component in oldpath or newpath does not exist or is
              a dangling symbolic link.

lockfile creates a temporary file, then links that to the file you
specify on the command line. When I was tracing through, I could see
that the temporary file was created. That suggests to me that the path
and permissions are OK. It just can't link. I ran it through strace, and
see:

   51   77145 [main] lockfile 4080 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
   50   77195 [main] lockfile 4080 fhandler_base::set_flags: filemode set to binary
   49   77244 [main] lockfile 4080 fhandler_base::open: 0 = NtCreateFile (0x6B4, 20100, C:\cygwin\tmp\_w_.CsgnEB.bdodge-lt, io, NULL, 0, 7, 1, 4400, NULL, 0)
   53   77297 [main] lockfile 4080 fhandler_base::open: 1 = fhandler_base::open (C:\cygwin\tmp\_w_.CsgnEB.bdodge-lt, 0x110000)
   51   77348 [main] lockfile 4080 fhandler_base::open_fs: 1 = fhandler_disk_file::open (C:\cygwin\tmp\_w_.CsgnEB.bdodge-lt, 0x10000)
 5656   83004 [main] lockfile 4080 fhandler_disk_file::link: CreateHardLinkA failed
   85   83089 [main] lockfile 4080 seterrno_from_win_error: /netrel/src/cygwin-1.5.19-4/winsup/cygwin/fhandler_disk_file.cc:786 windows error 3
   57   83146 [main] lockfile 4080 geterrno_from_win_error: windows error 3 == errno 2
   50   83196 [main] lockfile 4080 __set_errno: void seterrno_from_win_error(const char*, int, DWORD):310 val 2
   51   83247 [main] lockfile 4080 fhandler_base::close: closing '/tmp/_w_.CsgnEB.bdodge-lt' handle 0x6B4
   75   83322 [main] lockfile 4080 link: -1 = link (_w_.CsgnEB.bdodge-lt, foo)
   50   83372 [main] lockfile 4080 lstat64: entering
   49   83421 [main] lockfile 4080 normalize_posix_path: src _w_.CsgnEB.bdodge-lt
   48   83469 [main] lockfile 4080 cwdstuff::get: posix /tmp


So, I tried just linking a file:


  $ ls -il foo bar; touch foo && link foo bar && ls -il foo bar
  ls: foo: No such file or directory
  ls: bar: No such file or directory
  2251799813741751 -rw------- 2 bdodge mkgroup-l-d 0 Jun 24 20:56 bar
  2251799813741751 -rw------- 2 bdodge mkgroup-l-d 0 Jun 24 20:56 foo

Works fine, so I try seeing what happens with strace:

  $ ls -il foo bar; touch foo && strace link foo bar > strace.out 2>&1 && ls -il foo bar
  ls: foo: No such file or directory
  ls: bar: No such file or directory
  ls: bar: No such file or directory
  2814749767163063 -rw------- 1 bdodge mkgroup-l-d 0 Jun 24 20:58 foo

It doesn't work when run under strace. strace.out is below.

Any suggestions on how to make link work reliably on this system? I've
tried using the revs of lockfile(procmail) & cygwin from my old laptop
and the latest install.

Any chance the source of this problem is related to this:


<http://cygwin.com/ml/cygwin/2006-06/msg00186.html>

--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]