silence background operation

This commit is contained in:
Nikos Mavrogiannopoulos
2013-01-30 17:57:42 +01:00
parent e34d54318d
commit ac0f207579

View File

@@ -70,7 +70,7 @@ static void tls_log_func(int level, const char *str)
/* Returns 0 on success or negative value on error.
*/
static int
listen_ports(struct listen_list_st *list, const char *node,
listen_ports(struct cfg_st* config, struct listen_list_st *list, const char *node,
int listen_port, int socktype)
{
struct addrinfo hints, *res, *ptr;
@@ -103,6 +103,7 @@ listen_ports(struct listen_list_st *list, const char *node,
if (ptr->ai_family != AF_INET)
continue;
#endif
if (config->foreground != 0)
fprintf(stderr, "listening on %s...\n",
human_addr(ptr->ai_addr, ptr->ai_addrlen,
buf, sizeof(buf)));
@@ -350,7 +351,7 @@ int main(int argc, char** argv)
#warning read configuration from file
/* Listen to network ports */
ret = listen_ports(&llist, config.name, config.port, SOCK_STREAM);
ret = listen_ports(&config, &llist, config.name, config.port, SOCK_STREAM);
if (ret < 0) {
fprintf(stderr, "Cannot listen to specified ports\n");
exit(1);