[PATCH] Portability: use `uname -n` instead of `hostname`

Geert Hendrickx geert at hendrickx.be
Tue Oct 13 07:21:34 UTC 2020


On Mon, Oct 12, 2020 at 18:15:42 +0100, Sergey Kandaurov wrote:
> Whilst `uname -n` is certainly more portable than 4.2BSD'ish hostname(1),
> the former will barely work on win32 which is also ought to be supported.
> How about this change instead? It should work across all supported hosts.



Sure, if Sys::Hostname is bundled with standard perl, which appears
to be the case.

Looking at that module, on Unix it calls `uname -n` eventually. ;-)
On Windows indeed it still uses `hostname`.


	Geert



-- 
geert.hendrickx.be :: geert at hendrickx.be :: PGP: 0xC4BB9E9F
This e-mail was composed using 100% recycled spam messages!


More information about the nginx-devel mailing list