listen: return GError on "unix path too long"

When the unix domain socket path is too long, don't abort with
g_error().
This commit is contained in:
Max Kellermann 2009-03-01 13:35:44 +01:00
parent f2664e329f
commit 92db09fdf8

View File

@ -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);