diff -r 9844ac126275 -r 900f1124e8f8 lib/common.c --- a/lib/common.c Fri Oct 10 07:58:48 2008 +0000 +++ b/lib/common.c Fri Oct 10 08:34:15 2008 +0000 @@ -39,6 +39,7 @@ #include #include #include +#include #include "master.h" #include "master/ioctl.h" @@ -65,6 +66,9 @@ return 0; } + master->process_data = NULL; + master->process_data_size = 0; + snprintf(path, MAX_PATH_LEN - 1, "/dev/EtherCAT%u", master_index); master->fd = open(path, O_RDWR); @@ -89,6 +93,10 @@ void ecrt_release_master(ec_master_t *master) { + if (master->process_data) { + munmap(master->process_data, master->process_data_size); + } + close(master->fd); free(master); }