Hi!
> > > + SAFE_READ(cleanup, 0, fd, buf, BUF_SIZE);
> > > + if (sscanf(buf, "%d", &max_events) != 1) {
> > > +         tst_brkm(TBROK, cleanup,
> > > +                  "cannot parse max_queued_events file");
> > > + }
> > > + SAFE_CLOSE(cleanup, fd);
> > > +}
> > > +
> > > +static void cleanup(void)
> > > +{
> > > + if (myinotify_rm_watch(fd_notify, wd) < 0) {
> > > +         tst_resm(TWARN | TERRNO, "inotify_rm_watch (%d, %d) failed",
> > > +                  fd_notify, wd);
> > > +
> > > + }
> > > +
> > > + if (close(fd_notify) == -1) {
> > > +         tst_resm(TWARN, "close(%d) failed", fd_notify);
> > > + }
> > 
> > 
> > And I guess that we need to change this to:
> > 
> >     if (fd_notify > 0 && close(fd_notify) == -1)
> > 
> > 
> > because the fd_notify may be set to -1 in case that the syscall above
> > failed with ENOSYS which would generate a bogus warning. And I guess
> > that the same goes for the removing the inotify watch.
>   Well, yes. I can make that less verbose in case of missing inotify
> support. I was just following what is done in other inotify tests...

The problem is that TWARN gets propagated into the overall test result
so the test will not endup with clean TCONF in this case.

And unfortunately quite a lot of test cleanups are coded incorrectly in
LTP. :(


-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to