mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
unlink socket file before trying to bind to it
This commit is contained in:
parent
554e497593
commit
2af4888098
1 changed files with 1 additions and 0 deletions
|
@ -337,6 +337,7 @@ do_nbs_then_close( CommonGlobals* cGlobals, const TransportProcs* procs )
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
strcpy( addr.sun_path, cGlobals->params->nbs );
|
strcpy( addr.sun_path, cGlobals->params->nbs );
|
||||||
|
|
||||||
|
unlink( cGlobals->params->nbs );
|
||||||
int err = bind( sockfd, (struct sockaddr*)&addr, sizeof(addr) );
|
int err = bind( sockfd, (struct sockaddr*)&addr, sizeof(addr) );
|
||||||
if ( 0 != err ) {
|
if ( 0 != err ) {
|
||||||
XP_LOGF( "%s: bind=>%s", __func__, strerror( errno ) );
|
XP_LOGF( "%s: bind=>%s", __func__, strerror( errno ) );
|
||||||
|
|
Loading…
Add table
Reference in a new issue