Re: [PATCH v3 04/11] xfsprogs: Add ifdef dirent checks where it was missing

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

 



> diff --git a/io/readdir.c b/io/readdir.c
> index 20b8898..ed8f04d 100644
> --- a/io/readdir.c
> +++ b/io/readdir.c
> @@ -104,12 +104,16 @@ read_directory(
>  		if (!dirent)
>  			break;
>  
> +#ifdef _DIRENT_HAVE_D_RECLEN
>  		*total += dirent->d_reclen;
> +#endif

You probably want to use d_namen + sizeof(*dirent) to approimate
the value if d_reclen doesn't exist.

>  		count++;
>  
>  		if (dump) {
>  			dump_dirent(offset, dirent);
> +#ifdef _DIRENT_HAVE_D_OFF
>  			offset = dirent->d_off;
> +#endif

We're only using the offset for dumping the value, maybe setting
it to 0 and adding a comment explaining it should go into the else
branch here?

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux