diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-20 00:19:53 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-20 00:19:53 -0500 |
commit | 1fa3717743c217bb3dbe643a37a7ba96b5ff0ebd (patch) | |
tree | 07d68982ceb9c9201fe750d7f973012bb1eff133 /hscript/network.cc | |
parent | f4202f7fcf0484b31e36db187de8557a8eba3065 (diff) | |
download | horizon-1fa3717743c217bb3dbe643a37a7ba96b5ff0ebd.tar.gz horizon-1fa3717743c217bb3dbe643a37a7ba96b5ff0ebd.tar.bz2 horizon-1fa3717743c217bb3dbe643a37a7ba96b5ff0ebd.tar.xz horizon-1fa3717743c217bb3dbe643a37a7ba96b5ff0ebd.zip |
Make Installation Environment code conditional
Diffstat (limited to 'hscript/network.cc')
-rw-r--r-- | hscript/network.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/hscript/network.cc b/hscript/network.cc index 0921aaf..03c5a03 100644 --- a/hscript/network.cc +++ b/hscript/network.cc @@ -12,10 +12,12 @@ #include <algorithm> #include <arpa/inet.h> /* inet_pton */ -#include <linux/wireless.h> /* struct iwreq */ -#include <string.h> /* strerror */ -#include <sys/ioctl.h> /* ioctl, ioctl numbers */ -#include <unistd.h> /* close */ +#ifdef HAS_INSTALL_ENV +# include <linux/wireless.h> /* struct iwreq */ +# include <string.h> /* strerror */ +# include <sys/ioctl.h> /* ioctl, ioctl numbers */ +# include <unistd.h> /* close */ +#endif #include "network.hh" #include "util/output.hh" @@ -318,7 +320,7 @@ bool NetSSID::validate(ScriptOptions options) const { return true; } - /* LCOV_EXCL_START */ +#ifdef HAS_INSTALL_ENV struct iwreq request; int my_sock = ::socket(AF_INET, SOCK_STREAM, 0); if(my_sock == -1) { @@ -349,7 +351,9 @@ bool NetSSID::validate(ScriptOptions options) const { } ::close(my_sock); return true; - /* LCOV_EXCL_STOP */ +#else + return false; +#endif } bool NetSSID::execute(ScriptOptions) const { |