summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-15 22:41:20 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-15 22:41:20 -0400
commitd732aae2ca57430f3dd95c0ed4dcc05df4014f91 (patch)
tree01e423414ba3cfde862dea16a2d41ef46ef0e27c
parent66f612510a5df14f4a017809e1eec671aee8cc26 (diff)
downloaddevtools-libretools-20140515.tar.xz
arch-nspawn: use getconf to find HOST_NAME_MAX at runtime.libretools-20140515
This is at the suggestion of Roman Neuhauser, who emailed Dave Reisner and me.
-rw-r--r--arch-nspawn.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index e8b68cf..6c9a102 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -96,8 +96,7 @@ eval $(grep '^CARCH=' "$working_dir/etc/makepkg.conf")
machine_name="${working_dir//[![:alnum:]_-]/-}"
machine_name="${machine_name#-}"
-#HOST_NAME_MAX="$(cpp -include limits.h <<<HOST_NAME_MAX | sed -n '$p')"
-HOST_NAME_MAX=64
+HOST_NAME_MAX="$(getconf HOST_NAME_MAX)"
if [[ ${#machine_name} -gt "$HOST_NAME_MAX" ]]; then
machine_name="${machine_name:(-${HOST_NAME_MAX})}"
machine_name="${machine_name#-}"