<p>Kevin Harwell <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7169">View Change</a></p><p>Patch set 2:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I tested SIGHUP and SIGTERM against the asterisk PID on Fedora 26. <br>Both signals worked immediately with console, no fork and forking.</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_alertpipe enables non-blocking mode but I think this is fine<br>because we're using ast_poll (rather than letting read block).</p><p style="white-space: pre-wrap; word-wrap: break-word;">One thing I noticed ast_alertpipe_write says to see write(2) for<br>return value, but it actually returns zero on success and non-zero<br>on error. I don't know if we fix the implementation or docs?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I think both are fine? According to write(2) 0 is returned if nothing is written. Otherwise either the number of bytes written is returned or -1 on error. In some cases it might be prudent or even required to see if the number of bytes written matches the number of bytes attempted to be written.</p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7169/2/main/asterisk.c">File main/asterisk.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7169/2/main/asterisk.c@1769">Patch Set #2, Line 1769:</a> <code style="font-family:monospace,monospace"> if (ast_alertpipe_write(sig_alert_pipe)) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This should check if the return is -1. According to write(2) the number of bytes written is returned, so most of the time this will be true and then print an error when there was none.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/7169">change 7169</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7169"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Id4041a237d481ff699639e153ea6982fee14a462 </div>
<div style="display:none"> Gerrit-Change-Number: 7169 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 13 Nov 2017 22:52:06 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>