aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lpt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lpt.c b/src/lpt.c
index 44e63ad..2522673 100644
--- a/src/lpt.c
+++ b/src/lpt.c
@@ -190,17 +190,16 @@ static void *lpt_new(t_symbol *s, int argc, t_atom *argv)
x->device=-1;
x->port=strtol(devname, 0, 16);
if(0==x->port){
- x->port=-1;
#ifdef HAVE_PPDEV
x->device = open(devname, O_RDWR);
- if(x->device<0){
+ if(x->device<=0){
error("lpt: bad device %s", devname);
return(x);
} else {
if (ioctl (x->device, PPCLAIM)) {
perror ("PPCLAIM");
close (x->device);
- return(x);
+ x->device=-1;
}
}
#endif /* HAVE_PPDEV */