]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/receive-pack.c
xgethostname: handle long hostnames
[thirdparty/git.git] / builtin / receive-pack.c
index 3ca8ebe0e10a559a8036e5705df684b110e3b641..eee5faaa244ec0252305adbeddf7d5c5fa2d4eb0 100644 (file)
@@ -1660,7 +1660,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
                argv_array_pushl(&child.args, "index-pack",
                                 "--stdin", hdr_arg, NULL);
 
-               if (gethostname(hostname, sizeof(hostname)))
+               if (xgethostname(hostname, sizeof(hostname)))
                        xsnprintf(hostname, sizeof(hostname), "localhost");
                argv_array_pushf(&child.args,
                                 "--keep=receive-pack %"PRIuMAX" on %s",