Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
777844ae
Commit
777844ae
authored
Dec 15, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/SocketError, ...: use strerror() instead of g_strerror()
Avoid GLib.
parent
a10a4ad9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
CommandError.cxx
src/command/CommandError.cxx
+3
-4
FatalError.cxx
src/system/FatalError.cxx
+4
-1
SocketError.cxx
src/system/SocketError.cxx
+2
-2
Error.cxx
src/util/Error.cxx
+5
-2
No files found.
src/command/CommandError.cxx
View file @
777844ae
...
@@ -24,9 +24,8 @@
...
@@ -24,9 +24,8 @@
#include "util/Error.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
#include "Log.hxx"
#include <glib.h>
#include <assert.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <errno.h>
CommandResult
CommandResult
...
@@ -38,7 +37,7 @@ print_playlist_result(Client &client, PlaylistResult result)
...
@@ -38,7 +37,7 @@ print_playlist_result(Client &client, PlaylistResult result)
case
PlaylistResult
:
:
ERRNO
:
case
PlaylistResult
:
:
ERRNO
:
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
g_
strerror
(
errno
));
strerror
(
errno
));
return
CommandResult
::
ERROR
;
return
CommandResult
::
ERROR
;
case
PlaylistResult
:
:
DENIED
:
case
PlaylistResult
:
:
DENIED
:
...
@@ -115,7 +114,7 @@ print_error(Client &client, const Error &error)
...
@@ -115,7 +114,7 @@ print_error(Client &client, const Error &error)
}
}
}
else
if
(
error
.
IsDomain
(
errno_domain
))
{
}
else
if
(
error
.
IsDomain
(
errno_domain
))
{
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
g_
strerror
(
error
.
GetCode
()));
strerror
(
error
.
GetCode
()));
return
CommandResult
::
ERROR
;
return
CommandResult
::
ERROR
;
}
}
...
...
src/system/FatalError.cxx
View file @
777844ae
...
@@ -23,12 +23,15 @@
...
@@ -23,12 +23,15 @@
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include "LogV.hxx"
#include "LogV.hxx"
#ifdef WIN32
#include <glib.h>
#include <glib.h>
#endif
#include <unistd.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#ifdef WIN32
#include <windows.h>
#include <windows.h>
...
@@ -88,7 +91,7 @@ FatalSystemError(const char *msg)
...
@@ -88,7 +91,7 @@ FatalSystemError(const char *msg)
#ifdef WIN32
#ifdef WIN32
system_error
=
g_win32_error_message
(
GetLastError
());
system_error
=
g_win32_error_message
(
GetLastError
());
#else
#else
system_error
=
g_
strerror
(
errno
);
system_error
=
strerror
(
errno
);
#endif
#endif
FormatError
(
fatal_error_domain
,
"%s: %s"
,
msg
,
system_error
);
FormatError
(
fatal_error_domain
,
"%s: %s"
,
msg
,
system_error
);
...
...
src/system/SocketError.cxx
View file @
777844ae
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "SocketError.hxx"
#include "SocketError.hxx"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include <
glib
.h>
#include <
string
.h>
const
Domain
socket_domain
(
"socket"
);
const
Domain
socket_domain
(
"socket"
);
...
@@ -41,6 +41,6 @@ SocketErrorMessage::SocketErrorMessage(socket_error_t code)
...
@@ -41,6 +41,6 @@ SocketErrorMessage::SocketErrorMessage(socket_error_t code)
#else
#else
SocketErrorMessage
::
SocketErrorMessage
(
socket_error_t
code
)
SocketErrorMessage
::
SocketErrorMessage
(
socket_error_t
code
)
:
msg
(
g_
strerror
(
code
))
{}
:
msg
(
strerror
(
code
))
{}
#endif
#endif
src/util/Error.cxx
View file @
777844ae
...
@@ -21,11 +21,14 @@
...
@@ -21,11 +21,14 @@
#include "Error.hxx"
#include "Error.hxx"
#include "Domain.hxx"
#include "Domain.hxx"
#ifdef WIN32
#include <glib.h>
#include <glib.h>
#endif
#include <errno.h>
#include <errno.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
const
Domain
errno_domain
(
"errno"
);
const
Domain
errno_domain
(
"errno"
);
...
@@ -70,7 +73,7 @@ Error::FormatPrefix(const char *fmt, ...)
...
@@ -70,7 +73,7 @@ Error::FormatPrefix(const char *fmt, ...)
void
void
Error
::
SetErrno
(
int
e
)
Error
::
SetErrno
(
int
e
)
{
{
Set
(
errno_domain
,
e
,
g_
strerror
(
e
));
Set
(
errno_domain
,
e
,
strerror
(
e
));
}
}
void
void
...
@@ -82,7 +85,7 @@ Error::SetErrno()
...
@@ -82,7 +85,7 @@ Error::SetErrno()
void
void
Error
::
SetErrno
(
int
e
,
const
char
*
prefix
)
Error
::
SetErrno
(
int
e
,
const
char
*
prefix
)
{
{
Format
(
errno_domain
,
e
,
"%s: %s"
,
prefix
,
g_
strerror
(
e
));
Format
(
errno_domain
,
e
,
"%s: %s"
,
prefix
,
strerror
(
e
));
}
}
void
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment