<html><head></head><body>No it is not fine as already explained and as is obvious from reading most call sites.<br><br>-1<br><br><div class="gmail_quote">Le 9 décembre 2020 11:11:20 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2020-12-09 10:06, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Callers don't expect and can't handle ENOMEM error here. If you don't <br>understand, abstain from commenting instead of making stupid wrong comments.<br></blockquote><br>"Callers don't expect errors here" is very different than "Callers don't <br>expect and can't handle ENOMEM error here".<br><br>And the net_Accept() documentation doesn't mention that. And in fact, <br>apart from Lua that just passes on the value, all the callers check for <br>-1 and don't care about the actual type of errors.<br><br>So this fine is perfectly fine.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le 9 décembre 2020 08:50:43 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a <br>écrit :<br><br> This is a review of your comment which is a wrong assertion. Keep on topic.<br><br> On 2020-12-08 16:43, Rémi Denis-Courmont wrote:<br><br> Please keep your pointless sarcasms out of the code review.<br><br> Le 8 décembre 2020 17:20:37 GMT+02:00, Steve Lhomme<br> <robux4@ycbcr.xyz> a<br> écrit :<br><br> On 2020-12-08 16:12, Rémi Denis-Courmont wrote:<br><br> Callers don't expect errors here. Polling just has to work.<br><br> -1<br><br><br> yes, there are plenty of return -1, as seen in the patch.<br><br> Le 8 décembre 2020 16:19:13 GMT+02:00, "Hugo Beauzée-Luyssen"<br> <hugo@beauzee.fr> a écrit :<hr> src/network/io.c | 7 ++++++-<br> 1 file changed, 6 insertions(+), 1 deletion(-)<br><br> diff --git a/src/network/io.c b/src/network/io.c<br> index 5285edc169..d4f15fe115 100644<br> --- a/src/network/io.c<br> +++ b/src/network/io.c<br> @@ -313,7 +313,9 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> while (fds[n] != -1)<br> n++;<br><br> - struct pollfd ufd[n];<br> + struct pollfd *ufd = malloc(n * sizeof((*ufd)));<br> + if (!ufd)<br> + return -1;<br> /* Initialize file descriptor set */<br> for (unsigned i = 0; i < n; i++)<br> {<br> @@ -328,6 +330,7 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> if (net_errno != EINTR)<br> {<br> msg_Err(obj, "poll error: %s", vlc_strerror_c(net_errno));<br> + free(ufd);<br> return -1;<br> }<br> }<br> @@ -359,9 +362,11 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> */<br> memmove(fds + i, fds + i + 1, n - (i + 1));<br> fds[n - 1] = sfd;<br> + free(ufd);<br> return fd;<br> }<br> }<br> + free(ufd);<br> return -1;<br> }<br><br><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez<br> excuser<br> ma brièveté.<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>>><hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>>><br><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez<br> excuser<br> ma brièveté.<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>><hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a> <<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>><br><br><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser <br>ma brièveté.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>