- /* Set up ringbuffer */
-
- get_config_int(lookup_config(config_tree, "RingBufferSize"), &nbufs);
- if(nbufs <= 1)
- nbufs = 1;
- else if(nbufs > 256)
- nbufs = 256;
-
- bufs = xmalloc_and_zero(nbufs * sizeof *bufs);
-
- /* Create a listening socket */
-
- err = getaddrinfo(NULL, myport, &hint, &ai);
-
- if(err || !ai) {
- logger(LOG_ERR, _("System call `%s' failed: %s"), "getaddrinfo", gai_strerror(errno));
- return false;
- }
-
- sock = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);
-
- if(sock < 0) {
- logger(LOG_ERR, _("System call `%s' failed: %s"), "socket", strerror(errno));
- return false;
- }
-
- if(bind(sock, ai->ai_addr, ai->ai_addrlen)) {
- logger(LOG_ERR, _("System call `%s' failed: %s"), "bind", strerror(errno));
- return false;
- }
-
- freeaddrinfo(ai);
-
- if(listen(sock, 1)) {
- logger(LOG_ERR, _("System call `%s' failed: %s"), "listen", strerror(errno));
- return false;
- }
-