All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org,
	Marek Lindner <mareklindner@neomailbox.ch>
Subject: Re: [PATCH v2] alfred: notify event listener via unix socket
Date: Tue, 17 May 2022 13:32:38 +0200	[thread overview]
Message-ID: <150256550.B0Qo63onoq@ripper> (raw)
In-Reply-To: <10034333.HCmk49s6kI@rousseau>

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

On Tuesday, 17 May 2022 09:44:07 CEST Marek Lindner wrote:
[...]
> Thanks for preparing the rebase & code change patches. Wouldn't you say that 
> EPOLL_CTL_DEL somewhere near unix_sock_event_listener_free() could be helpful?
> 
> Something like:
> -static void unix_sock_event_listener_free(struct event_listener *listener)
> +static void unix_sock_event_listener_free(struct globals *globals,
> +                                         struct event_listener *listener)
>  {
>         list_del(&listener->list);
> +       epoll_ctl(globals->epollfd, EPOLL_CTL_DEL, listener->fd, NULL);
>         close(listener->fd);
>         free(listener);
>  }

No, alfred doesn't share file descriptors and thus close of the fd will do 
this for us [1]. 

Kind regards,
	Sven


[1] https://man7.org/linux/man-pages/man7/epoll.7.html
    "Will closing a file descriptor cause it to be removed from
     all epoll interest lists?"
    

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2022-05-17 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 11:46 [PATCH v2] alfred: notify event listener via unix socket Marek Lindner
2022-05-14  9:51 ` Sven Eckelmann
2022-05-17  7:44   ` Marek Lindner
2022-05-17 11:32     ` Sven Eckelmann [this message]

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=150256550.B0Qo63onoq@ripper \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=mareklindner@neomailbox.ch \
    /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.