All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin <mlspirat42@gmail.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: andreas.faerber@web.de, jan.kiszka@web.de, qemu-devel@nongnu.org,
	Benjamin MARSILI <marsil_b@epitech.eu>
Subject: Re: [Qemu-devel] [PATCH v2] Support for UDP unicast network backend
Date: Wed, 30 Nov 2011 02:29:50 +0900	[thread overview]
Message-ID: <4ED5168E.5080304@gmail.com> (raw)
In-Reply-To: <CAJSP0QUFFafNJuUCNQ6f8A+qG0BRPK9QGqO6yQCK_pdbdzY=Vw@mail.gmail.com>

On 11/28/11 20:39, Stefan Hajnoczi wrote:
> On Fri, Nov 25, 2011 at 12:49 PM, Benjamin<mlspirat42@gmail.com>  wrote:
>> +    fd = qemu_socket(PF_INET, SOCK_DGRAM, 0);
>> +    if (fd<  0) {
>> +        perror("socket(PF_INET, SOCK_DGRAM)");
>> +        return -1;
>> +    }
>> +    val = 1;
>> +    ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
>> +                   (const char *)&val, sizeof(val));
>> +    if (ret<  0) {
>> +        perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)");
>
> Please avoid leaking the file descriptor on error:
> closesocket(fd);
>
> Since existing code also does this it may be more appropriate to send
> a follow-up patch that cleans up all of net/socket.c.
>
> Reviewed-by: Stefan Hajnoczi<stefanha@linux.vnet.ibm.com>
>
> Stefan

I can do that. However is it really a leak considering the fact that
the program will call exit just after?
If it's a matter of consistency and coding style I would understand
though.

One more thing, git-format-patch added a "From" field to the header and
caused this glitch in the mail. I thought git-send-mail or the mail
server would handle it well but apparently not:

 From 2f5b85fcadcfee3b75a6a21dc86d10b945c99f0f Mon Sep 17 00:00:00 2001
From: Benjamin MARSILI <marsil_b@epitech.eu>

git-am didn't complain with the patch that I sent but it may break after
gmail relayed it 
(http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg03152.html).
The second from header is interpreted as text... Should I remove the
first "From" field before sending the patch?

Sorry for the noise on the ML and thanks to all those who helped me get
involved.

Benjamin

  reply	other threads:[~2011-11-29  8:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 12:49 [Qemu-devel] [PATCH v2] Support for UDP unicast network backend Benjamin
2011-11-28 11:39 ` Stefan Hajnoczi
2011-11-29 17:29   ` Benjamin [this message]
2011-11-29  9:47     ` Stefan Hajnoczi
2011-11-29 19:45       ` Benjamin
  -- strict thread matches above, loose matches on Subject: below --
2011-10-06 17:08 [Qemu-devel] Integrating Dynamips and GNS3 UDP tunnels (Patches) Benjamin Epitech
2011-10-07  8:35 ` Jan Kiszka
2011-10-08 17:31   ` Benjamin
2011-10-08  9:29     ` Jan Kiszka
2011-11-06 20:55       ` [Qemu-devel] [PATCH] Support for UDP unicast network backend Benjamin
2011-11-06 13:54         ` Jan Kiszka
2011-11-07 14:01           ` Benjamin
2011-11-07 11:23             ` Jan Kiszka
2011-11-07 22:03               ` Benjamin
2011-11-08 10:52                 ` Jan Kiszka
2011-11-09 14:26                   ` Benjamin
2011-11-09 14:53                     ` Benjamin
2011-11-09 10:41                       ` Andreas Färber
2011-11-24  1:02                         ` [Qemu-devel] [PATCH v2] " Benjamin
2011-11-24  9:13                           ` Stefan Hajnoczi

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=4ED5168E.5080304@gmail.com \
    --to=mlspirat42@gmail.com \
    --cc=andreas.faerber@web.de \
    --cc=jan.kiszka@web.de \
    --cc=marsil_b@epitech.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.