add some missing errno.h and string.h includes
--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/571
MOS_MIGRATED_REVID=107471259
diff --git a/src/main/cpp/blaze_startup_options.cc b/src/main/cpp/blaze_startup_options.cc
index 7e0a158..efceba3 100644
--- a/src/main/cpp/blaze_startup_options.cc
+++ b/src/main/cpp/blaze_startup_options.cc
@@ -16,6 +16,7 @@
#include <assert.h>
#include <errno.h> // errno, ENOENT
#include <stdlib.h> // getenv, exit
+#include <string.h> // strerror
#include <unistd.h> // access
#include <cstdio>
diff --git a/src/main/cpp/blaze_util_freebsd.cc b/src/main/cpp/blaze_util_freebsd.cc
index ca58355..2317795 100644
--- a/src/main/cpp/blaze_util_freebsd.cc
+++ b/src/main/cpp/blaze_util_freebsd.cc
@@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <errno.h> // errno, ENAMETOOLONG
+#include <libprocstat.h>
#include <limits.h>
#include <pwd.h>
+#include <signal.h>
#include <string.h> // strerror
#include <sys/mount.h>
#include <sys/param.h>
@@ -23,8 +26,6 @@
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
-#include <signal.h>
-#include <libprocstat.h>
#include "src/main/cpp/blaze_util.h"
#include "src/main/cpp/blaze_util_platform.h"
diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc
index 867fbb2..1f1144c 100644
--- a/src/main/cpp/blaze_util_linux.cc
+++ b/src/main/cpp/blaze_util_linux.cc
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <errno.h> // errno, ENAMETOOLONG
#include <limits.h>
#include <pwd.h>
#include <string.h> // strerror
diff --git a/src/main/cpp/blaze_util_mingw.cc b/src/main/cpp/blaze_util_mingw.cc
index 3719e0d..3cf3394 100644
--- a/src/main/cpp/blaze_util_mingw.cc
+++ b/src/main/cpp/blaze_util_mingw.cc
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <errno.h>
+#include <errno.h> // errno, ENAMETOOLONG
#include <limits.h>
#include <string.h> // strerror
+#include <sys/cygwin.h>
#include <sys/socket.h>
#include <sys/statfs.h>
-#include <sys/cygwin.h>
#include <unistd.h>
#include <windows.h>
diff --git a/src/main/cpp/util/file.cc b/src/main/cpp/util/file.cc
index 3ada5a5..d6b62a0 100644
--- a/src/main/cpp/util/file.cc
+++ b/src/main/cpp/util/file.cc
@@ -13,7 +13,6 @@
// limitations under the License.
#include "src/main/cpp/util/file.h"
-#include <errno.h> // EINVAL
#include <limits.h> // PATH_MAX
#include <sys/stat.h>
#include <unistd.h> // access
diff --git a/src/main/cpp/util/numbers.cc b/src/main/cpp/util/numbers.cc
index 6ad7c1d..2e3b109 100644
--- a/src/main/cpp/util/numbers.cc
+++ b/src/main/cpp/util/numbers.cc
@@ -13,9 +13,9 @@
// limitations under the License.
#include "src/main/cpp/util/numbers.h"
-#include <stdint.h>
-#include <errno.h>
+#include <errno.h> // errno, ERANGE
#include <limits.h>
+#include <stdint.h>
#include <cassert>
#include <cstdlib>
#include <limits>
diff --git a/src/test/cpp/blaze_util_test.cc b/src/test/cpp/blaze_util_test.cc
index 301b2d0..02fec70 100644
--- a/src/test/cpp/blaze_util_test.cc
+++ b/src/test/cpp/blaze_util_test.cc
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>