From e81bb5d8f18c3d4de9a591cd85cd33a2a47692a6 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Wed, 16 Sep 2020 20:38:29 +0200
Subject: [PATCH] db/update/Inotify*: include cleanup

---
 src/db/update/InotifySource.cxx |  8 ++++----
 src/db/update/InotifySource.hxx |  3 ---
 src/db/update/InotifyUpdate.cxx | 10 +++++-----
 src/db/update/InotifyUpdate.hxx |  2 --
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/db/update/InotifySource.cxx b/src/db/update/InotifySource.cxx
index e0509715c..ac3c931ff 100644
--- a/src/db/update/InotifySource.cxx
+++ b/src/db/update/InotifySource.cxx
@@ -24,11 +24,11 @@
 #include "system/Error.hxx"
 #include "Log.hxx"
 
+#include <cerrno>
+#include <climits>
+#include <cstdint>
+
 #include <sys/inotify.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdint.h>
-#include <limits.h>
 
 bool
 InotifySource::OnSocketReady(gcc_unused unsigned flags) noexcept
diff --git a/src/db/update/InotifySource.hxx b/src/db/update/InotifySource.hxx
index dadefec90..43225df56 100644
--- a/src/db/update/InotifySource.hxx
+++ b/src/db/update/InotifySource.hxx
@@ -21,9 +21,6 @@
 #define MPD_INOTIFY_SOURCE_HXX
 
 #include "event/SocketMonitor.hxx"
-#include "util/Compiler.h"
-
-class FileDescriptor;
 
 typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask,
 				       const char *name, void *ctx);
diff --git a/src/db/update/InotifyUpdate.cxx b/src/db/update/InotifyUpdate.cxx
index 0885aa435..b19961ade 100644
--- a/src/db/update/InotifyUpdate.cxx
+++ b/src/db/update/InotifyUpdate.cxx
@@ -27,13 +27,13 @@
 #include "fs/Traits.hxx"
 #include "Log.hxx"
 
-#include <string>
-#include <map>
+#include <cassert>
+#include <cstring>
 #include <forward_list>
+#include <map>
+#include <string>
 
-#include <assert.h>
 #include <sys/inotify.h>
-#include <string.h>
 #include <dirent.h>
 
 static constexpr unsigned IN_MASK =
@@ -148,7 +148,7 @@ WatchDirectory::GetUriFS() const noexcept
 static bool skip_path(const char *path)
 {
 	return PathTraitsFS::IsSpecialFilename(path) ||
-		strchr(path, '\n') != nullptr;
+		std::strchr(path, '\n') != nullptr;
 }
 
 static void
diff --git a/src/db/update/InotifyUpdate.hxx b/src/db/update/InotifyUpdate.hxx
index 8f9f7d99b..47fda5e66 100644
--- a/src/db/update/InotifyUpdate.hxx
+++ b/src/db/update/InotifyUpdate.hxx
@@ -20,8 +20,6 @@
 #ifndef MPD_INOTIFY_UPDATE_HXX
 #define MPD_INOTIFY_UPDATE_HXX
 
-#include "util/Compiler.h"
-
 class EventLoop;
 class Storage;
 class UpdateService;