aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-01 13:35:44 +0100
committerMax Kellermann <max@duempel.org>2009-03-01 13:35:44 +0100
commit92db09fdf8d672fa6c78e726102ad66145d076f4 (patch)
tree7452b17bd5f664904f09d8665ff9c8d55887b6d2 /src
parentf2664e329f8e85281b7676d3cd543973408607d0 (diff)
downloadmpd-92db09fdf8d672fa6c78e726102ad66145d076f4.tar.gz
mpd-92db09fdf8d672fa6c78e726102ad66145d076f4.tar.xz
mpd-92db09fdf8d672fa6c78e726102ad66145d076f4.zip
listen: return GError on "unix path too long"
When the unix domain socket path is too long, don't abort with g_error().
Diffstat (limited to 'src')
-rw-r--r--src/listen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/listen.c b/src/listen.c
index 25801a24c..616466330 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -337,8 +337,11 @@ listen_add_path(const char *path, GError **error)
bool success;
path_length = strlen(path);
- if (path_length >= sizeof(s_un.sun_path))
- g_error("unix socket path is too long");
+ if (path_length >= sizeof(s_un.sun_path)) {
+ g_set_error(error, listen_quark(), 0,
+ "unix socket path is too long");
+ return false;
+ }
unlink(path);