Skip to content

Commit

Permalink
kbuild: fix warning when domainname is not available
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Contreras authored and Sam Ravnborg committed Oct 11, 2009
1 parent 58242b2 commit 9c3049c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/mkcompile_h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c3049c

Please sign in to comment.