change errno.h to cerrno

The former is deprecated by C++14. It's also functionally the same. From the standard: 19.4 The header<cerrno>is described in Table 43. Its contents are the same as the POSIX header<errno.h>,except that errno shall be defined as a macro. [Note: The intent is to remain in close alignment with the POSIX standard.] A separate errno value shall be provided for each thread. Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent 2b3d6461
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "util/Exception.hxx" #include "util/Exception.hxx"
#include <cerrno>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h>
static constexpr Domain exception_domain("exception"); static constexpr Domain exception_domain("exception");
......
...@@ -49,10 +49,9 @@ ...@@ -49,10 +49,9 @@
#include "fs/io/GzipOutputStream.hxx" #include "fs/io/GzipOutputStream.hxx"
#endif #endif
#include <cerrno>
#include <memory> #include <memory>
#include <errno.h>
static constexpr Domain simple_db_domain("simple_db"); static constexpr Domain simple_db_domain("simple_db");
inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block) inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
#include "system/Error.hxx" #include "system/Error.hxx"
#include "Log.hxx" #include "Log.hxx"
#include <cerrno>
#include <sys/inotify.h> #include <sys/inotify.h>
#include <errno.h>
#include <stdint.h> #include <stdint.h>
#include <limits.h> #include <limits.h>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "Log.hxx" #include "Log.hxx"
#include <errno.h> #include <cerrno>
bool bool
GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept
......
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
#include "Log.hxx" #include "Log.hxx"
#include <cassert> #include <cassert>
#include <cerrno>
#include <exception> #include <exception>
#include <memory> #include <memory>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
UpdateWalk::UpdateWalk(const UpdateConfig &_config, UpdateWalk::UpdateWalk(const UpdateConfig &_config,
EventLoop &_loop, DatabaseListener &_listener, EventLoop &_loop, DatabaseListener &_listener,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <algorithm> #include <algorithm>
#ifdef USE_EPOLL #ifdef USE_EPOLL
#include <errno.h> #include <cerrno>
#endif #endif
#ifndef _WIN32 #ifndef _WIN32
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include "Limits.hxx" #include "Limits.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
#include <errno.h> #include <cerrno>
#include <fcntl.h> #include <fcntl.h>
void void
......
...@@ -158,9 +158,10 @@ FileOutputStream::Cancel() noexcept ...@@ -158,9 +158,10 @@ FileOutputStream::Cancel() noexcept
#else #else
#include <cerrno>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#ifdef HAVE_O_TMPFILE #ifdef HAVE_O_TMPFILE
#ifndef O_TMPFILE #ifndef O_TMPFILE
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include "system/Error.hxx" #include "system/Error.hxx"
#include <errno.h> #include <cerrno>
#include <stdio.h> #include <stdio.h>
static size_t static size_t
......
...@@ -44,9 +44,10 @@ ...@@ -44,9 +44,10 @@
#include <net/if.h> #include <net/if.h>
#endif #endif
#include <cerrno>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h>
static inline bool static inline bool
ai_is_passive(const struct addrinfo *ai) ai_is_passive(const struct addrinfo *ai)
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
#include <netinet/tcp.h> #include <netinet/tcp.h>
#endif #endif
#include <errno.h> #include <cerrno>
#include <string.h> #include <string.h>
int int
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <winsock2.h> #include <winsock2.h>
typedef DWORD socket_error_t; typedef DWORD socket_error_t;
#else #else
#include <errno.h> #include <cerrno>
typedef int socket_error_t; typedef int socket_error_t;
#endif #endif
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
#include "Log.hxx" #include "Log.hxx"
#include "open.h" #include "open.h"
#include <cerrno>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
class FifoOutput final : AudioOutput { class FifoOutput final : AudioOutput {
......
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
#include "Log.hxx" #include "Log.hxx"
#include <cassert> #include <cassert>
#include <cerrno>
#include <iterator> #include <iterator>
#include <stdexcept> #include <stdexcept>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
#include "system/FileDescriptor.hxx" #include "system/FileDescriptor.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
#include <cerrno>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#if defined(__sun) #if defined(__sun)
#include <sys/audio.h> #include <sys/audio.h>
......
...@@ -92,7 +92,8 @@ FormatLastError(const char *fmt, Args&&... args) noexcept ...@@ -92,7 +92,8 @@ FormatLastError(const char *fmt, Args&&... args) noexcept
#endif /* _WIN32 */ #endif /* _WIN32 */
#include <errno.h> #include <cerrno>
#include <string.h> #include <string.h>
/** /**
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#else #else
#include <errno.h> #include <cerrno>
#endif #endif
static constexpr Domain fatal_error_domain("fatal_error"); static constexpr Domain fatal_error_domain("fatal_error");
......
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
#include "fs/io/FileOutputStream.hxx" #include "fs/io/FileOutputStream.hxx"
#include "util/PrintException.hxx" #include "util/PrintException.hxx"
#include <cerrno>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment