This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: [patch] lockf() fix


>>>>> Ben Collins writes:

 > This seems to only affect sparc, sparc64 and alpha, since they are the
 > only ones that define F_RDLCK to something other than 0 (1, in each case).

 > Thanks to Anton Blanchard for helping me track this down.

 > --- ./sysdeps/generic/lockf.c~	Fri Oct 27 18:43:40 2000
 > +++ ./sysdeps/generic/lockf.c	Fri Oct 27 18:34:25 2000
 > @@ -32,6 +32,7 @@
 >    memset ((char *) &fl, '\0', sizeof (fl));
 >  
 >    /* lockf is always relative to the current file position.  */
 > +  fl.l_type = F_RDLCK;
 >    fl.l_whence = SEEK_CUR;
 >    fl.l_start = 0;
 >    fl.l_len = len;

I don't understand why this is needed at all.  Looking at the code
each of the switch cases sets l_type explicitly.  Is l_type needed for
the fcntl (fd, F_GETLK) ?

If your patch would be right, the same patch would be needed for
lockf64.

Please explain a bit more why this is needed - or send a simple test
program that fails on those architectures.

Thanks,
Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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