<html>#2214: Cactus: handle error in gethostname
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>resolved</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Changes (by Roland Haas):</p>
<p><table>
<tr><td>status:</td><td>resolved (was open)</td></tr>
</table></p>
<p>This works around deficiencies of the gethostname call, namely that it does not return an error of the supplied buffer is too small and that it may not include a NUL byte at the end of the buffer if the buffer was too small and the returned name was truncated.</p>
<p>This should not happen (often) in practise since glibc already has a similar workaround in place, but may happen eg on a Mac if they indeed use a non glibc C library.</p>
<p>Pull request is here: <a href="https://bitbucket.org/cactuscode/cactus/pull-requests/55/cactus-handle-error-in-gethostname/diff" rel="nofollow" class="ap-connect-link">https://bitbucket.org/cactuscode/cactus/pull-requests/55/cactus-handle-error-in-gethostname/diff</a></p>
<p><strong>Keyword:</strong> None</p>
<p>Comment (by Roland Haas):</p>
<p>Applied as git hash <a data-is-external-link="true" href="https://bitbucket.org/cactuscode/cactus/commits/0c12d0c7be04f5e06b616c2039ae19a3db84841d" rel="nofollow">0c12d0c7</a> "Cactus: handle error in gethostname" of <a data-is-external-link="true" href="https://bitbucket.org/cactuscode/cactus" rel="nofollow">cactus</a></p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2214/cactus-handle-error-in-gethostname'>https://bitbucket.org/einsteintoolkit/tickets/issues/2214/cactus-handle-error-in-gethostname</a></p>
</html>