[CRIU] [PATCH] test: inotify00 -- Rework test

Cyrill Gorcunov gorcunov at gmail.com
Wed Sep 3 12:58:01 PDT 2014


On Wed, Sep 03, 2014 at 11:32:48PM +0400, Andrew Vagin wrote:
> >  
> > -const char path[] = "inotify-removed";
> > +#define TEST_DIR	"inotify-test"
> 
> Could you use the --dirname option? Look at static/cwd00.

Sure, thanks.

> >  
> >  #define BUFF_SIZE ((sizeof(struct inotify_event) + PATH_MAX))
> >  
> > +static int rmdir_force(const char *directory)
> 
> I don't like this function. Can we just unlink all expected files in the
> test directory?

OK

...

> > +
> > +	if (open(TEST_FILE_PATH, O_CREAT | O_TRUNC) < 0) {
> 
> man 2 open:
> 
> mode specifies the permissions to use in case a new file is created.
> This argument must be supplied when O_CREAT
> 
> And I think you need to set O_WRONLY or O_RDWR

This is optional (hint: see libc source code) but I'll address it.


More information about the CRIU mailing list