diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2009-09-17 00:38:39 +0300 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-10-11 23:21:25 +0200 |
commit | 9c3049c02c6142e166c9472237f1f60d86153682 (patch) | |
tree | 624f892c23db814575a62debbf3e6a5981889f9b | |
parent | 58242b2b065557f8467a8630f7c9b2b4b2eb891f (diff) | |
download | linux-3.10-9c3049c02c6142e166c9472237f1f60d86153682.tar.gz linux-3.10-9c3049c02c6142e166c9472237f1f60d86153682.tar.bz2 linux-3.10-9c3049c02c6142e166c9472237f1f60d86153682.zip |
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>
-rwxr-xr-x | scripts/mkcompile_h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 6a12dd9f118..f060763c0c6 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 |