On Wed, 2005-08-03 at 14:58 +0100, Anton Altaparmakov wrote:
> On Wed, 2005-08-03 at 06:53 -0700, Yura Pakhuchiy wrote:
> > Changes by: cha0smaster
> >
> > Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
> > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27378/ntfsprogs
> >
> > Modified Files:
> > ntfsmount.c
> > Log Message:
> > * attrib.c: refix ntfs_attr_p{read,write}
> > * ntfsmount.c: code that now not really needed, but for any case
> >
> >
> > Index: ntfsmount.c
> > ===================================================================
> > RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
> > retrieving revision 1.18
> > retrieving revision 1.19
> > diff -u -p -r1.18 -r1.19
> > --- ntfsmount.c 1 Aug 2005 22:04:28 -0000 1.18
> > +++ ntfsmount.c 3 Aug 2005 13:52:51 -0000 1.19
> > @@ -398,11 +397,25 @@ static int ntfs_fuse_read(const char *or
> > res = -errno;
> > goto exit;
> > }
> > - res = ntfs_attr_pread(na, offset, size, buf);
> > - if (res == -1)
> > - res = -errno;
> > - ntfs_attr_close(na);
> > + if (offset + size > na->data_size)
> > + size = na->data_size - offset;
> > + while (size) {
> > + res = ntfs_attr_pread(na, offset, size, buf);
> > + if (res < size)
> > + perror("ntfs_attr_pread returned less bytes than "
> > + "requested.");
>
> Using perror in this case is wrong. When res < size but res >= 0, errno
> is not set thus you are using a random errno from whenever something
> else failed...
Thanks, will fix.
--
Best regards,
Yura
|