Commit aba65e22 authored by Daan Vreeken [PA4DAN]'s avatar Daan Vreeken [PA4DAN]
Browse files

Committer: Daan Vreeken [PA4DAN] <pa4dan@RacebeestV3.VEHosting.LAN>

	modified:   common/log/log.c
	modified:   common/utils/weather.c
	modified:   controller/controller/controller_command.c
	modified:   controller/controller/controller_trace.c
	modified:   controller/shell/shell.c

	Don't use PTHREAD_STACK_MIN as thread stack size on FreeBSD.
	PTHREAD_STACK_MIN must be huge on Linux for all this code to work. On
	FreeBSD the code will generally hit the end of the stack before the
	third function call.
parent 86ce73d1
......@@ -318,7 +318,9 @@ int log_server_start(int port, enum log_type console_level,
printf("Starting log server on port %d\n", port);
pthread_attr_init(&attr);
#ifndef __FreeBSD__
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN * 2);
#endif
pthread_create(&thread_id, &attr, log_server, NULL);
......
......@@ -136,7 +136,9 @@ struct weather *weather_create(char *location)
}
pthread_attr_init(&attr);
#ifndef __FreeBSD__
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN * 2);
#endif
pthread_create(&thread_id, &attr, weather_http, weather);
......
......@@ -326,7 +326,9 @@ void controller_command_server_start(int portnr, int max)
controller_command_server_port = portnr;
pthread_attr_init(&attr);
#ifndef __FreeBSD__
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN * 2);
#endif
pthread_create(&thread_id, &attr,
controller_command_server, NULL);
pthread_create(&thread_id, &attr,
......
......@@ -521,7 +521,9 @@ void controller_trace_server_start(int portnr, int max)
controller_trace_server_port = portnr;
pthread_attr_init(&attr);
#ifndef __FreeBSD__
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN * 2);
#endif
pthread_create(&thread_id, &attr,
controller_trace_server, NULL);
pthread_create(&thread_id, &attr,
......
......@@ -363,7 +363,9 @@ int shell_server_start(int port, int clients)
clients, port);
pthread_attr_init(&attr);
#ifndef __FreeBSD__
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN * 2);
#endif
pthread_create(&thread_id, &attr, shell_server, NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment