[Asterisk-code-review] res timing: Don't close FD 0 when out of open files. (asterisk[11])

Walter Doekes asteriskteam at digium.com
Thu Jul 2 07:45:58 CDT 2015


Walter Doekes has posted comments on this change.

Change subject: res_timing: Don't close FD 0 when out of open files.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/759/1/res/res_timing_timerfd.c
File res/res_timing_timerfd.c:

Line 93: 	if (timer->handle > -1) {
       : 		close(timer->handle);
       : 	}
> Per the description of your commit message, shouldn't this be:
No. It's perfectly legal to close fd 0 *if* it were returned by the timerfd_create() call.

The point is that it's now not 0 anymore when timerfd_create() returns -1. Thus we won't accidentally close the calloc'ed fd 0.


-- 
To view, visit https://gerrit.asterisk.org/759
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I147d7e33726c6e5a2751928d56561494f5800350
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list