xgethostname: handle long hostnames
[gitweb.git] / ident.c
diff --git a/ident.c b/ident.c
index 8ec0f25987540ccf64230b6aad4c6e2323d43455..7e386a48fa8331e69fae2a7b6a86b770e370cec5 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -122,7 +122,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
 {
        char buf[HOST_NAME_MAX + 1];
 
-       if (gethostname(buf, sizeof(buf))) {
+       if (xgethostname(buf, sizeof(buf))) {
                warning_errno("cannot get host name");
                strbuf_addstr(out, "(none)");
                *is_bogus = 1;