From 8c4246f2adb5100f229bbbe52259e50a3161b839 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 7 Nov 2016 08:58:26 +0100 Subject: [PATCH] net/SocketError: remove obsolete Error functions --- src/net/SocketError.cxx | 3 --- src/net/SocketError.hxx | 38 -------------------------------------- 2 files changed, 41 deletions(-) diff --git a/src/net/SocketError.cxx b/src/net/SocketError.cxx index 53c9f9a18..d332058ad 100644 --- a/src/net/SocketError.cxx +++ b/src/net/SocketError.cxx @@ -19,13 +19,10 @@ #include "config.h" #include "SocketError.hxx" -#include "util/Domain.hxx" #include "util/Macros.hxx" #include -const Domain socket_domain("socket"); - #ifdef WIN32 SocketErrorMessage::SocketErrorMessage(socket_error_t code) diff --git a/src/net/SocketError.hxx b/src/net/SocketError.hxx index 0effe6992..b2f685cf7 100644 --- a/src/net/SocketError.hxx +++ b/src/net/SocketError.hxx @@ -22,7 +22,6 @@ #include "Compiler.h" #include "system/Error.hxx" -#include "util/Error.hxx" // IWYU pragma: export #ifdef WIN32 #include @@ -32,14 +31,6 @@ typedef DWORD socket_error_t; typedef int socket_error_t; #endif -class Domain; - -/** - * A #Domain for #Error for socket I/O errors. The code is an errno - * value (or WSAGetLastError() on Windows). - */ -extern const Domain socket_domain; - gcc_pure static inline socket_error_t GetSocketError() @@ -108,35 +99,6 @@ public: } }; -static inline void -SetSocketError(Error &error, socket_error_t code) -{ - const SocketErrorMessage msg(code); - error.Set(socket_domain, code, msg); -} - -static inline void -SetSocketError(Error &error) -{ - SetSocketError(error, GetSocketError()); -} - -gcc_const -static inline Error -NewSocketError(socket_error_t code) -{ - Error error; - SetSocketError(error, code); - return error; -} - -gcc_pure -static inline Error -NewSocketError() -{ - return NewSocketError(GetSocketError()); -} - gcc_const static inline std::system_error MakeSocketError(socket_error_t code, const char *msg)