<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">In r228601 I check the return value to avoid needing to zero the end, and added a comment that when it fails we just ignore hostname.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 9, 2015, at 11:51 AM, Ben Langmuir <<a href="mailto:blangmuir@apple.com" class="">blangmuir@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 9, 2015, at 11:40 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra">Nits:</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Feb 9, 2015 at 11:23 AM, Ben Langmuir <span dir="ltr" class=""><<a href="mailto:blangmuir@apple.com" target="_blank" class="">blangmuir@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":515" class="a3s" style="overflow:hidden">+  char hostname[256];<br class="">
+  hostname[255] = 0;<br class="">
+  hostname[0] = 0;<br class="">
+  gethostname(hostname, 255);<br class=""></div></blockquote><div class=""><br class=""></div><div class="">It would be good to document that we want to actively ignore any error here.</div><div class=""><br class=""></div><div class="">Also, pedantically you should set [255] to 0 here rather than above. POSIX doesn't require null termination in the event it is truncated.</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Ah, I misread the manpage as saying the max length was always <= 255, which is why I thought we couldn’t get ENAMETOOLONG or truncate.  Will fix as suggested.</div><div class=""><br class=""></div><div class="">Thanks for the review,</div><div class=""><br class=""></div><div class="">Ben</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":515" class="a3s" style="overflow:hidden">
+  code = hash_combine(code, StringRef(hostname));<br class="">
+#endif</div></blockquote></div><br class=""><br class=""></div></div>
</div></blockquote></div><br class=""></div>_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@cs.uiuc.edu" class="">cfe-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br class=""></div></blockquote></div><br class=""></body></html>