public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Markos Chandras <Markos.Chandras@imgtec.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v3]  dup3(2): add EINVAL error number test
Date: Thu, 28 Nov 2013 18:09:51 +0100	[thread overview]
Message-ID: <20131128170951.GA18651@rei.Home> (raw)
In-Reply-To: <52977568.9070306@imgtec.com>

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)

Looking at fcntl.h in uClibc git the O_CLOEXEC is defined only on
__USE_GNU

Does adding

#define _GNU_SOURCE

before the includes help?

If not, your uClibc version does not yet support it and we will have to
add:

#ifndef O_CLOEXEC
# define O_CLOEXEC 02000000
#endif

To fix it.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-11-28 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 10:36 [LTP] [PATCH v3] dup3(2): add EINVAL error number test Xiaoguang Wang
2013-11-28 14:35 ` chrubis
2013-11-28 16:55   ` Markos Chandras
2013-11-28 17:09     ` chrubis [this message]
     [not found]       ` <52977A31.8060400@imgtec.com>
2013-11-28 17:21         ` chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131128170951.GA18651@rei.Home \
    --to=chrubis@suse.cz \
    --cc=Markos.Chandras@imgtec.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox