#include "usb_driver.h"
#include "proto.h"
-#define CONTROL_FIFO_PATH "/var/tmp/devmand_control"
#define SERVICE_BINARY "/bin/service"
* cleanup *
*===========================================================================*/
static void cleanup() {
- int res;
struct devmand_driver_instance *inst;
/* destroy fifo */
dbg("cleaning up... ");
run_downscript (inst);
stop_driver(inst);
}
- res = remove(CONTROL_FIFO_PATH);
- if (res != 0) {
- fprintf(stderr, "WARNING: could not remove control fifo");
- }
unlink("/var/run/devmand.pid");
}
*===========================================================================*/
int main(int argc, char *argv[])
{
- int opt, optindex, res;
+ int opt, optindex;
struct devmand_usb_driver *driver;
create_pid_file();
- /* create control socket if not exists */
- res = mkfifo(CONTROL_FIFO_PATH, S_IWRITE);
-
- if ( !((res == 0) || (res == EEXIST)) ) {
- fprintf(stderr, "Could not create control FIFO (%d)\n", res);
- exit(1);
- }
-
parse_config();
LIST_FOREACH(driver, &drivers, list) {
run_cleanscript(driver);
fclose(fd);
if (res == NULL) {
- /* TODO: wait for control events */
usleep(50000);
continue;
}