From d01890078c281453db8d5fc8ea7c082d0ce9782b Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 20 Oct 2019 00:22:18 -0500 Subject: hscript: Finish splitting install env code --- hscript/disk.cc | 2 ++ hscript/network.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hscript/disk.cc b/hscript/disk.cc index 9d700dd..5d3112f 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -47,6 +47,7 @@ bool DiskId::validate(ScriptOptions options) const { /* We only validate if running in an Installation Environment. */ if(!options.test(InstallEnvironment)) return true; +#ifdef HAS_INSTALL_ENV /* Unlike 'mount', 'diskid' *does* require that the block device exist * before installation begins. This test is always valid. */ struct stat blk_stat; @@ -62,6 +63,7 @@ bool DiskId::validate(ScriptOptions options) const { "diskid: " + _block + " is not a valid block device"); return false; } +#endif /* HAS_INSTALL_ENV */ return true; } diff --git a/hscript/network.cc b/hscript/network.cc index 03c5a03..27e8a9e 100644 --- a/hscript/network.cc +++ b/hscript/network.cc @@ -17,6 +17,9 @@ # include /* strerror */ # include /* ioctl, ioctl numbers */ # include /* close */ +#else +/*! The size of Linux interface names. */ +# define IFNAMSIZ 16 #endif #include "network.hh" #include "util/output.hh" -- cgit v1.2.3-60-g2f50