summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1862f17)
raw | patch | inline | side by side (parent: 1862f17)
author | Florian Forster <octo@noris.net> | |
Fri, 5 Dec 2008 10:29:54 +0000 (11:29 +0100) | ||
committer | Florian Forster <octo@noris.net> | |
Fri, 5 Dec 2008 10:29:54 +0000 (11:29 +0100) |
If called multiple times, the global `sock_fd' variable will be re-set,
breaking the plugin.
breaking the plugin.
src/unixsock.c | patch | blob | history |
diff --git a/src/unixsock.c b/src/unixsock.c
index d80091b1bd18bfffd290ae4c7a54b6086131605f..3dac88a49b437ec8105c170faf1366c65178f605 100644 (file)
--- a/src/unixsock.c
+++ b/src/unixsock.c
static int us_init (void)
{
+ static int have_init = 0;
+
int status;
+ /* Initialize only once. */
+ if (have_init != 0)
+ return (0);
+ have_init = 1;
+
loop = 1;
status = pthread_create (&listen_thread, NULL, us_server_thread, NULL);