spawnv() unlocks files in the calling program

Corinna Vinschen corinna-cygwin@cygwin.com
Sun Feb 9 19:50:00 GMT 2014


On Feb  9 13:25, Steven Bardwell wrote:
> I have a simple programs that show the following issue:
> 
> 1) program locks a file (in my test /tmp/yyy)
> 2) program then calls spawnv() (in my test    "/bin/sh  -c  /bin/touch
> /tmp/xxx").
> 3) after the spawnv(), the file /tmp/yyy is no longer locked.

How do you test that?  You're calling fcntl(F_SETLKW) exactly once at
the start of your test application, but never again later.  We're
talking advisory file locking here, so, where's the next fcntl call
waiting for the lock?

I debugged your test app and the lock still exists after the spawn call.



Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140209/3416c1ac/attachment.sig>


More information about the Cygwin mailing list