1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

small fixes and cleanups

This commit is contained in:
Steffen Vogel 2015-03-21 18:03:55 +01:00
parent f2734a395e
commit 9cfdf4c874
5 changed files with 12 additions and 16 deletions

View file

@ -31,7 +31,7 @@ struct interface * if_create(int index) {
i->index = index;
if_indextoname(index, i->name);
debug(3, "Created interface '%s'", i->name, i->index, i->refcnt);
debug(3, "Created interface '%s' (index=%u)", i->name, i->index);
list_init(&i->sockets, NULL);
list_push(&interfaces, i);

View file

@ -152,7 +152,7 @@ int opal_read(struct node *n, struct msg *m)
if ((ret = OpalWaitForAsyncSendRequest(&id)) != EOK) {
state = OpalGetAsyncModelState();
if ((state == STATE_RESET) || (state == STATE_STOP)) {
info("OpalGetAsyncModelState(): Model stopped or resetted!");
warn("OpalGetAsyncModelState(): Model stopped or resetted!");
die();
}
@ -194,7 +194,7 @@ int opal_read(struct node *n, struct msg *m)
* has not been stopped. If it has, we quit. */
state = OpalGetAsyncModelState();
if ((state == STATE_RESET) || (state == STATE_STOP)) {
info("OpalGetAsyncModelState(): Model stopped or resetted!");
warn("OpalGetAsyncModelState(): Model stopped or resetted!");
die();
}
@ -212,7 +212,7 @@ int opal_write(struct node *n, struct msg *m)
state = OpalGetAsyncModelState();
if ((state == STATE_RESET) || (state == STATE_STOP)) {
info("OpalGetAsyncModelState(): Model stopped or resetted!");
warn("OpalGetAsyncModelState(): Model stopped or resetted!");
die();
}

View file

@ -40,6 +40,7 @@ int main(int argc, char *argv[])
printf("Simulator2Simulator Server %s (built on %s %s)\n", BLU(VERSION), MAG(__DATE__), MAG(__TIME__));
printf(" Copyright 2014, Institute for Automation of Complex Power Systems, EONERC\n");
printf(" Steffen Vogel <stvogel@eonerc.rwth-aachen.de>\n");
exit(EXIT_FAILURE);
}

View file

@ -34,8 +34,8 @@ extern struct list paths;
extern struct list interfaces;
/** The global configuration */
struct settings settings;
config_t config;
static struct settings settings;
static config_t config;
static void quit()
{
@ -61,18 +61,13 @@ static void quit()
list_destroy(&interfaces);
config_destroy(&config);
info("Goodbye!");
_exit(EXIT_SUCCESS);
}
void realtime_init()
{ INDENT
/* Check for realtime kernel patch */
struct stat st;
if (stat("/sys/kernel/realtime", &st))
warn("Use a RT-preempt patched Linux for lower latencies!");
else
info("Server is running on a realtime patched kernel");
/* Use FIFO scheduler with real time priority */
if (settings.priority) {
struct sched_param param = { .sched_priority = settings.priority };
@ -144,7 +139,7 @@ int main(int argc, char *argv[])
list_init(&paths, (dtor_cb_t) path_destroy);
list_init(&interfaces, (dtor_cb_t) if_destroy);
/* Start initialization */
info("Initialize realtime system:");
realtime_init();

View file

@ -122,9 +122,9 @@ int main(int argc, char *argv[])
error("Unknown option '-%c'.", optopt);
else
error("Unknown option character '\\x%x'.", optopt);
exit(1);
exit(EXIT_FAILURE);
default:
abort ();
abort();
}
continue;