diff -r 13cb18b91627 -r 0b70040d3daa lib/common.c --- a/lib/common.c Thu Oct 02 07:14:00 2008 +0000 +++ b/lib/common.c Thu Oct 02 10:19:02 2008 +0000 @@ -38,14 +38,17 @@ #include #include #include +#include -#include "include/ecrt.h" +#include "master.h" #include "master/ioctl.h" -struct ec_master { - int fd; - void *handle; -}; +/*****************************************************************************/ + +unsigned int ecrt_version_magic(void) +{ + return ECRT_VERSION_MAGIC; +} /*****************************************************************************/ @@ -55,7 +58,6 @@ { char path[MAX_PATH_LEN]; ec_master_t *master; - ec_ioctl_request_t data; master = malloc(sizeof(ec_master_t)); if (!master) { @@ -72,7 +74,7 @@ return 0; } - if (ioctl(master->fd, EC_IOCTL_REQUEST, &data) == -1) { + if (ioctl(master->fd, EC_IOCTL_REQUEST, NULL) == -1) { fprintf(stderr, "Failed to request master %u: %s\n", master_index, strerror(errno)); close(master->fd); @@ -80,7 +82,6 @@ return 0; } - master->handle = data.handle; return master; } @@ -93,10 +94,3 @@ } /*****************************************************************************/ - -unsigned int ecrt_version_magic(void) -{ - return ECRT_VERSION_MAGIC; -} - -/*****************************************************************************/