diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-11 18:20:54 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-11 18:20:54 +0800 |
commit | dbc9f181f9893ca95951ff566ece95d421622d90 (patch) | |
tree | 21ac98ec05bc50c26ffa0e4649bf0caaf4e06689 /common/sys | |
parent | 02fa211cd301928b075083bf457e02daed462f1b (diff) | |
download | pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar.gz pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar.bz2 pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar.lz pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar.xz pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.tar.zst pttbbs-dbc9f181f9893ca95951ff566ece95d421622d90.zip |
- (internal) un sockets requires removing file path first.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4131 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'common/sys')
-rw-r--r-- | common/sys/net.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/sys/net.c b/common/sys/net.c index df33392e..27f7975c 100644 --- a/common/sys/net.c +++ b/common/sys/net.c @@ -50,6 +50,9 @@ int tobind(const char * addr) servaddr.sun_family = AF_UNIX; strlcpy(servaddr.sun_path, addr, sizeof(servaddr.sun_path)); + // remove the file first if it exists. + unlink(servaddr.sun_path); + if (bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) { perror("bind()"); exit(1); |