summaryrefslogtreecommitdiff
path: root/scripts/mkcompile_h
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2009-09-17 01:38:39 +0400
committerSam Ravnborg <sam@ravnborg.org>2009-10-12 01:21:25 +0400
commit9c3049c02c6142e166c9472237f1f60d86153682 (patch)
tree624f892c23db814575a62debbf3e6a5981889f9b /scripts/mkcompile_h
parent58242b2b065557f8467a8630f7c9b2b4b2eb891f (diff)
downloadlinux-9c3049c02c6142e166c9472237f1f60d86153682.tar.xz
kbuild: fix warning when domainname is not available
Otherwise we get: "dnsdomainname: Unknown host" Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/mkcompile_h')
-rwxr-xr-xscripts/mkcompile_h8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 6a12dd9f1181..f060763c0c6a 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then
- echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
+ domain=`dnsdomainname 2> /dev/null`
elif [ -x /bin/domainname ]; then
- echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
+ domain=`domainname 2> /dev/null`
+ fi
+
+ if [ -n "$domain" ]; then
+ echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
else
echo \#define LINUX_COMPILE_DOMAIN
fi