server: Fix fake "Address already in use" error
authorLiu Wenlong <liuwl.fnst@cn.fujitsu.com>
Mon, 26 Aug 2019 09:08:22 +0000 (17:08 +0800)
committerLiu Wenlong <liuwl.fnst@cn.fujitsu.com>
Mon, 26 Aug 2019 17:32:45 +0000 (01:32 +0800)
commit152c9ed968124c253f0be25b76c2a083a21af37e
treec805903009b9c7070aae6344efe0ce99e8851245
parent17e49ba8443d76f05df89c9663e3661af292a1a4
server: Fix fake "Address already in use" error

In the current workflow, socket file will be deleted if it already exists.
However, if the socket file is a symbolic link and the file that it refers
to doesn't exist, we will got "Address already in use" because bind()
thinks the socket file exists and won't create it.

Now, use lstat() to determine whether the socket file exists.

Signed-off-by: Liu Wenlong <liuwl.fnst@cn.fujitsu.com>
src/wayland-server.c