Re: update-menus error
On Thu, Mar 29, 2001 at 09:25:03AM +0200, Joost Witteveen wrote:
> On Wed, Mar 28, 2001 at 11:29:05PM +0200, Marcus Brinkmann wrote:
> > On Wed, Mar 28, 2001 at 11:24:04PM +0200, Cord Beermann wrote:
> > > Hallo! Du (Joost Witteveen) hast geschrieben:
> > >
> > > >Doesn't matter. It is totally clear what goes wrong, and I assume stracing
> > > >wouldn't show much.
> > > >
> > > >Apparently you are the only one who sees the problem on Hurd. Is your hurd
> > > >in any way special (why do the others not see your problem)?
> >
> > Joost, we talked about this in the past
>
> Are you sure? I remember talking, but I seem to recall that then the
> error message was different.
>
> Anyway, now it seems it's quite clearly a Hurd/libc problem with the fcntl
> implementation, and it should be possible to generate a 10-line test
> prorgamme for this bug, and maybe get it fixed in Hurd.
> This is the code that goes wrong (menu/update-menus.cc:731):
>
> fd=open(DPKG_LOCKFILE, O_RDWR|O_CREAT|O_TRUNC, 0660);
> if(fd==-1)
> return 0; // used to be 1, but why??? (Should not happen, anyway)
> fl.l_type= F_WRLCK;
> fl.l_whence= SEEK_SET;
> fl.l_start= 0;
> fl.l_len= 0;
> if (fcntl(fd,F_SETLK,&fl) == -1) {
> close(fd);
"and a library function that does succeed is allowed
to change errno." -- errno manpage
fcntl has an error, but when close is called it wipes errno, setting
it to no value of importance since it succeeds.
> if (errno == EWOULDBLOCK || errno == EAGAIN || errno == EACCES)
> return 1;
> cerr<<"update-menus: Encountered an unknown errno (="
> <<errno<<")."<<endl
--
Adam Olsen, aka Rhamphoryncus
Reply to: