chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Bug in posix-module: file-lock


From: Felix Winkelmann
Subject: Re: [Chicken-users] Bug in posix-module: file-lock
Date: Mon, 08 Sep 2003 07:11:53 +0200
User-agent: Opera7.11/Win32 M2 build 2887

On Mon, 08 Sep 2003 04:36:53 +0200, Johannes Groedem <address@hidden> wrote:

There seems to be a bug in file-lock in posix.scm.  When attempting to
get a lock on an output-port, it will call fcntl with flock.l_type set
to FD_RDLCK instead of FD_WRLCK.  (I straced the program, having some
problems finding my way around the source.)  Getting locks for
input-ports works as it should, though.

What's strange is that from a quick glance at posix.scm, the code
seems to be correct.


In posix.scm, the port is checked wether it's for input or
output. The following line in `setup' (before the definition
of `file-lock' seems to be wrong):

(##core#inline "C_flock_setup" (if (##sys#slot port 1) _f_wrlck _f_rdlck) start len)

It should be:

(##core#inline "C_flock_setup" (if (##sys#slot port 1) _f_rdlck _f_wrlck) start len)

I've simply mixed up the order. Tne 1st slot in a port is #t for input- ports.


cheers,
felix





reply via email to

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