mirror of
https://github.com/0intro/wmii
synced 2025-03-05 14:41:25 +03:00
we unlink now socket files, the server creator has to take care of not using existing socket files
This commit is contained in:
parent
2d97fc681b
commit
048e3e7c0c
@ -106,13 +106,6 @@ dummy_error_handler(Display * dpy, XErrorEvent * err)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
exit_cleanup()
|
||||
{
|
||||
if(mypid == getpid())
|
||||
unlink(address);
|
||||
}
|
||||
|
||||
static void
|
||||
new_item()
|
||||
{
|
||||
@ -753,7 +746,6 @@ main(int argc, char *argv[])
|
||||
root_qid.path = mkqpath(Droot, 0);
|
||||
|
||||
mypid = getpid();
|
||||
atexit(exit_cleanup);
|
||||
|
||||
/* default item settings */
|
||||
new_item();
|
||||
|
@ -163,6 +163,7 @@ create_unix_sock(char *file, char **errstr)
|
||||
strncpy(addr.sun_path, file, sizeof(addr.sun_path));
|
||||
su_len = sizeof(struct sockaddr) + strlen(addr.sun_path);
|
||||
|
||||
unlink(file); /* remove old socket, if any */
|
||||
if(bind(fd, (struct sockaddr *) &addr, su_len) < 0) {
|
||||
*errstr = "cannot bind socket";
|
||||
close(fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user