On 2015-03-31 20:52:52, Seth Arnold wrote:
> On Thu, Mar 26, 2015 at 04:47:57PM -0500, Tyler Hicks wrote:
> > The _aa_dirat_for_each() function used the DIR * type for its first
> > parameter. It then switched back and forth between the directory file
> > descriptors, retrieved with dirfd(), and directory streams, retrieved
> > with fdopendir(), when making syscalls and calling the call back
> > function.
> > 
> > This patch greatly simplifies the function by simply using directory
> > file descriptors. No functionality is lost since callers can still
> > easily use the function after calling dirfd() to retrieve the underlying
> > file descriptor.
> > 
> > Signed-off-by: Tyler Hicks <tyhi...@canonical.com>
> 
> I like the gist of this patch but I think the parameter shouldn't be named
> dirfd; if we ever need the dirent.h header back again, this'll cause no
> end of confusion. It'd be safer to just pick a less obvious name, dir_fd
> for example.

Thanks for the review!

The "dirfd" naming convention is used in all of the *at(2) calls:

 int faccessat(int dirfd, const char *pathname, int mode, int flags);
 int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
 int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags);
 int openat(int dirfd, const char *pathname, int flags);
 ...

That said, I don't mind changing it. I think prefer "dfd" over "dir_fd".
Does that sound good?

Tyler

> 
> With a name change,
> Acked-by: Seth Arnold <seth.arn...@canonical.com>
> 
> Thanks



> -- 
> AppArmor mailing list
> AppArmor@lists.ubuntu.com
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/apparmor

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to