From 28b5992e03b617805d2d24d14b4f7844b52d268f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 13 May 2013 19:33:52 +0200 Subject: [PATCH] +Nejsou prava na port - musis byt root --- lptgpib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lptgpib.c b/lptgpib.c index 2a9f244..c5bbd62 100644 --- a/lptgpib.c +++ b/lptgpib.c @@ -84,7 +84,10 @@ void sig_handler(int sig){ void lptgpib_init(int base){ lpt_base = base; - ioperm(lpt_base, 4, 1); + if (ioperm(lpt_base, 4, 1) != 0) { + fprintf(stderr,"Nejsou prava na port - musis byt root: %m\n"); + exit(1); + } /* set realtime priority and lock us in memory */ struct sched_param scp; -- 1.8.3.1