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:
parent
f2664e329f
commit
92db09fdf8
@ -337,8 +337,11 @@ listen_add_path(const char *path, GError **error)
|
|||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
path_length = strlen(path);
|
path_length = strlen(path);
|
||||||
if (path_length >= sizeof(s_un.sun_path))
|
if (path_length >= sizeof(s_un.sun_path)) {
|
||||||
g_error("unix socket path is too long");
|
g_set_error(error, listen_quark(), 0,
|
||||||
|
"unix socket path is too long");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user