mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fix correct shutdown
This commit is contained in:
parent
4670e946aa
commit
9837efdd58
4 changed files with 11 additions and 1 deletions
|
@ -55,6 +55,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
struct config_t config;
|
||||
|
||||
_mtid = pthread_self();
|
||||
|
||||
while ((c = getopt(argc, argv, "hr")) != -1) {
|
||||
switch (c) {
|
||||
case 'r': reverse = 1; break;
|
||||
|
|
|
@ -54,6 +54,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
char c;
|
||||
int reverse = 0;
|
||||
|
||||
_mtid = pthread_self();
|
||||
|
||||
struct config_t config;
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ void quit(int sig, siginfo_t *si, void *ptr)
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
config_t config;
|
||||
|
||||
_mtid = pthread_self();
|
||||
|
||||
if (argc < 4) {
|
||||
printf("Usage: %s CONFIG TEST NODE [ARGS]\n", argv[0]);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <netdb.h>
|
||||
#include <math.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef ENABLE_OPAL_ASYNC
|
||||
#define RTLAB
|
||||
|
@ -28,7 +29,10 @@ pthread_t _mtid;
|
|||
|
||||
void die()
|
||||
{
|
||||
pthread_kill(_mtid, SIGINT);
|
||||
if (pthread_equal(_mtid, pthread_self()))
|
||||
exit(EXIT_FAILURE);
|
||||
else
|
||||
pthread_kill(_mtid, SIGINT);
|
||||
}
|
||||
|
||||
int strap(char *dest, size_t size, const char *fmt, ...)
|
||||
|
|
Loading…
Add table
Reference in a new issue