Index: libirman-0.4.1b/irio.c =================================================================== --- libirman-0.4.1b.orig/irio.c 1999-02-18 12:20:59.000000000 +0100 +++ libirman-0.4.1b/irio.c 2006-08-02 16:11:14.000000000 +0200 @@ -38,6 +38,8 @@ # include #endif +#include + #include "irman.h" /* wrapper for ir_close_port() for use by atexit() */ @@ -74,6 +76,7 @@ int ir_open_port(char *filename) { int parnum = 0; + int status; #ifdef SUNATTEMPT int hand = TIOCM_DTR | TIOCM_RTS; #endif @@ -169,6 +172,28 @@ if (fcntl(portfd, F_SETFL, (portflags |= O_NONBLOCK)) < 0) { return -1; } + + /* we power down the device */ + if(ioctl(portfd, TIOCMGET, &status) < 0) + { + perror("could not get status\n"); + return -1; + } + status &= ~(TIOCM_DTR|TIOCM_RTS); + if(ioctl(portfd, TIOCMSET, &status) < 0) + { + perror("could not set power down"); + return -1; + } + ir_usleep(IR_POWER_ON_LATENCY); + + /* now power up again */ + status |= (TIOCM_DTR|TIOCM_RTS); + if(ioctl(portfd, TIOCMSET, &status) < 0) + { + perror("could not set power up"); + return -1; + } #ifdef SUNATTEMPT /* raise the control lines to power the unit*/ Index: libirman-0.4.1b/Makefile.in =================================================================== --- libirman-0.4.1b.orig/Makefile.in 1999-02-18 12:14:57.000000000 +0100 +++ libirman-0.4.1b/Makefile.in 2006-08-02 16:17:17.000000000 +0200 @@ -16,7 +16,7 @@ CC = @CC@ MKFIFO = @MKFIFO@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ -Wall CPPFLAGS = -I. @CPPFLAGS@ @DEFS@ LDFLAGS = @LDFLAGS@ -L. -lirman LDFLAGS_SW = @LDFLAGS@ -L. -lirman_sw @@ -105,9 +105,9 @@ mkdev: if test z`echo $(MKFIFO) | sed 's/.*\///g'` = zmknod; then \ - test -p $(LIRC_DRIVER_DEVICE) || $(MKFIFO) $(LIRC_DRIVER_DEVICE) p ;\ + test -e $(LIRC_DRIVER_DEVICE) || $(MKFIFO) $(LIRC_DRIVER_DEVICE) p ;\ else \ - test -p $(LIRC_DRIVER_DEVICE) || $(MKFIFO) $(LIRC_DRIVER_DEVICE) ;\ + test -e $(LIRC_DRIVER_DEVICE) || $(MKFIFO) $(LIRC_DRIVER_DEVICE) ;\ fi rmdev: Index: libirman-0.4.1b/lirmand.c =================================================================== --- libirman-0.4.1b.orig/lirmand.c 1999-02-18 12:15:02.000000000 +0100 +++ libirman-0.4.1b/lirmand.c 2006-08-02 16:16:30.000000000 +0200 @@ -63,30 +63,30 @@ int lirc = 0; /* file descriptor */ int is_daemon = 0; -FILE *log = NULL; +FILE *logfile = NULL; FILE *open_log(void) { time_t t=time(NULL); - if (!log) { - log = fopen(LIRMAND_LOGFILE, "a"); - if (log) { - fprintf(log, "%s started at %s\n", progname, ctime(&t)); + if (!logfile) { + logfile = fopen(LIRMAND_LOGFILE, "a"); + if (logfile) { + fprintf(logfile, "%s started at %s\n", progname, ctime(&t)); } } - return log; + return logfile; } void close_log(void) { time_t t = time(NULL); - if (log) { - fprintf(log, "%s stopped at %s\n", progname, ctime(&t)); - fclose(log); + if (logfile) { + fprintf(logfile, "%s stopped at %s\n", progname, ctime(&t)); + fclose(logfile); } - log = NULL; + logfile = NULL; } @@ -99,7 +99,7 @@ return 0; va_start(va, format); - ret = vfprintf(log, format, va); + ret = vfprintf(logfile, format, va); va_end(va); return ret; @@ -114,8 +114,8 @@ va_start(va, format); if (open_log()) { - ret = fprintf(log, "error: "); - ret += vfprintf(log, format, va); + ret = fprintf(logfile, "error: "); + ret += vfprintf(logfile, format, va); } if (!is_daemon) { ret = fprintf(stderr, "%s: ", progname);