1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Test old instance of BIRD.

This commit is contained in:
Ondrej Filip
2004-06-06 17:05:25 +00:00
parent cd09226078
commit 41c8976e29
4 changed files with 39 additions and 5 deletions

View File

@@ -1194,3 +1194,23 @@ io_loop(void)
}
}
}
void
test_old_bird(char *path)
{
int fd;
struct sockaddr_un sa;
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0)
die("Cannot create socket: %m");
bzero(&sa, sizeof(sa));
sa.sun_family = AF_UNIX;
strcpy(sa.sun_path, path);
if (connect(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == 0)
die("I found another BIRD running.");
close(fd);
}