On Thu, 2008-12-11 at 11:37 -0800, Brandon Philips wrote:
> On 08:32 Fri 05 Dec 2008, [email protected] wrote:
> > + if (mq_notify(mqd, ¬if) == (mqd_t)-1) {
> > + tst_resm(TBROK, "parent: mq_notify() failed (%s)",
> > + strerror(errno));
> > + mq_close(mqd);
> > + mq_unlink(mqname);
> > + remove_pipe(father_to_child);
> > + cleanup(TBROK);
> > + }
>
> Please abstract this cleanup code into a function...
Fixed this in both testcases, about to send a v3.
Thanks for the review!
Nadia
>
> > + if (sigaction(SIGUSR1, &sa, NULL) == -1) {
> > + tst_resm(TBROK, "parent: sigaction() failed(%s)",
> > + strerror(errno));
> > + mq_notify(mqd, NULL);
> > + mq_close(mqd);
> > + mq_unlink(mqname);
> > + remove_pipe(father_to_child);
> > + cleanup(TBROK);
> > + }
>
> +1
>
> > + if (write(father_to_child[1], "f:ok", 5) != 5) {
> > + tst_resm(TBROK, "parent: pipe is broken(%s)", strerror(errno));
> > + mq_notify(mqd, NULL);
> > + mq_close(mqd);
> > + mq_unlink(mqname);
> > + remove_pipe(father_to_child);
> > + cleanup(TBROK);
> > + }
>
> +2
>
> > + /* Wait for child to finish */
> > + if (wait(&status) == -1) {
> > + tst_resm(TBROK, "parent: wait() failed(%s)", strerror(errno));
> > + mq_close(mqd);
> > + mq_unlink(mqname);
> > + remove_pipe(father_to_child);
> > + cleanup(TBROK);
> > + }
> > +
> > + mq_close(mqd);
> > + mq_unlink(mqname);
> > + close(father_to_child[1]);
> > + cleanup(result);
>
> +3
>
> Cheers,
>
> Brandon
>
--
Nadia Derbey <[email protected]>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list