All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix bug when stdin is closed
@ 2022-05-07 23:54 Greg Depoire--Ferrer
  2022-05-07 23:54 ` [PATCH 1/3] main: Accept FD 0 as epoll_fd Greg Depoire--Ferrer
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Greg Depoire--Ferrer @ 2022-05-07 23:54 UTC (permalink / raw)
  To: ell

Running iwd with FD 0 (stdin) closed fails because ell considers epoll_fd of 0 to mean failure. The first commit fixes
that bug.

However, it still won't work because ell/dhcp6-transport.c has a bug where it closes a uninitialized FD (FD 0 on my
machine) and that would cause an infinite loop because the epoll_wait call was returning EBADF. The second commit fixes
that bug.

I noticed that ell/dhcp-transport.c is prone to the same mistake as the udp_fd field is not initialized on construction,
but I don't know if the close can actually be called before the udp_fd field is set. Just to be sure, the third commit
initializes it.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-06 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 23:54 Fix bug when stdin is closed Greg Depoire--Ferrer
2022-05-07 23:54 ` [PATCH 1/3] main: Accept FD 0 as epoll_fd Greg Depoire--Ferrer
2022-05-07 23:54 ` [PATCH 2/3] dhcp6-transport: Remove udp_fd field Greg Depoire--Ferrer
2022-05-07 23:54 ` [PATCH 3/3] dhcp-transport: Initialize the " Greg Depoire--Ferrer
2022-06-06 18:17   ` Denis Kenzior
2022-06-06 18:18 ` Fix bug when stdin is closed Denis Kenzior

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.