On 11/28/2013 02:35 PM, [email protected] wrote: > Hi! >> +static void cleanup(void) >> +{ >> + TEST_CLEANUP; >> + >> + SAFE_CLOSE(cleanup, old_fd); > > Take care not to call cleanup() from within a cleanup() > > If the close() here will fail, the cleanup will be called, then the > close() will fail and the cleanup will be called... untill the end of > the stack and the test will eventually SegFault. > > Also if the SAFE_CREAT() in setup() will fail, the close() will fail > too, because the old_fd will be set to -1. > > I've fixed that this time and pushed (see diff bellow), thanks. > > > @@ -117,7 +117,8 @@ static void cleanup(void) > { > TEST_CLEANUP; > > - SAFE_CLOSE(cleanup, old_fd); > + if (old_fd > 0) > + SAFE_CLOSE(NULL, old_fd); > > tst_rmdir(); > } >
Hello, This test does not seem to compile on uClibc based systems I am getting this: dup3_02.c:53: error: 'O_CLOEXEC' undeclared here (not in a function) -- markos ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
