public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] netstress.c: convert to new library API
Date: Mon, 30 Jan 2017 14:13:43 +0100	[thread overview]
Message-ID: <20170130131342.GC29227@rei.lan> (raw)
In-Reply-To: <837482ef-0ac4-0a3b-3c4e-598ed6ce96e1@oracle.com>

Hi!
> >>   	shutdown(*fd, SHUT_WR);
> >> -	SAFE_CLOSE(cleanup, *fd);
> >> +	SAFE_CLOSE(*fd);
> >>   	*fd = -1;
> > FYI the SAFE_CLOSE() already sets fd to -1.
> 
> Ah, it's not, 'fd' passed by value there... I've blindly removed it
> from code but now I need to return it back.

Are you sure? SAFE_CLOSE() is a macro which expands to:

	do {
		safe_close("foo", 42, NULL, (*fd));
		(*fd) = -1;
	} while (0)

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-01-30 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 13:36 [LTP] [PATCH 1/3] tst_test: add tst_parse_long() Alexey Kodanev
2016-12-19 13:36 ` [LTP] [PATCH 2/3] tst_test: add macro helper to invoke pthread_once() Alexey Kodanev
2017-01-23 14:58   ` Cyril Hrubis
2016-12-19 13:36 ` [LTP] [PATCH 3/3] netstress.c: convert to new library API Alexey Kodanev
2017-01-23 14:57   ` Cyril Hrubis
2017-01-27 14:07     ` Alexey Kodanev
2017-01-30 13:13       ` Cyril Hrubis [this message]
2017-01-30 13:32         ` Alexey Kodanev
2017-01-23 14:26 ` [LTP] [PATCH 1/3] tst_test: add tst_parse_long() Cyril Hrubis

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=20170130131342.GC29227@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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