Attention is currently required from: plaisthos, srkyn.

cron2 has posted comments on this change by srkyn. ( 
http://gerrit.openvpn.net/c/openvpn/+/1881?usp=email )

Change subject: compat: close all unrelated fds in forked helpers
......................................................................


Patch Set 2:

(2 comments)

File src/compat/close-fds.c:

http://gerrit.openvpn.net/c/openvpn/+/1881/comment/7bc3ef82_ca4ebbb3?usp=email :
PS2, Line 42:         const int lower_closed = keep == 3 || close_range(3, 
(unsigned int)keep - 1, 0) == 0;
> This should probably be `bool` instead.
... and please avoid complex conditional operator constructs with side effects 
in assignments.  I only had two coffees today and I find this line beyond my C 
parsing skills right now.

This looks like we're calling `close_range()` way too often anyway - figure out 
the lower boundary in an understandable `if()` clause (or a conditional 
assignment), then call `close_range( first, last, 0 )`.


http://gerrit.openvpn.net/c/openvpn/+/1881/comment/bb033b37_333e2356?usp=email :
PS2, Line 63:             close((int)i);
if we cast the to-be-closed file descriptor to `(int)` here, using `long` as a 
loop index is not the right thing to do.



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1881?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iacd56d245e9ab30cfb25b2b364ca661fa289dc55
Gerrit-Change-Number: 1881
Gerrit-PatchSet: 2
Gerrit-Owner: srkyn <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-Reviewer: razvanc <[email protected]>
Gerrit-CC: cron2 <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: srkyn <[email protected]>
Gerrit-Comment-Date: Sat, 29 Aug 2026 16:37:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: razvanc <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to