Use comedi_perror to report error if comedi_open fails, and exit with exit
authorIan Abbott <abbotti@mev.co.uk>
Thu, 13 Jul 2006 17:06:33 +0000 (17:06 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 13 Jul 2006 17:06:33 +0000 (17:06 +0000)
code 1.

demo/info.c

index 2885c6e99a6aaf83801c2f4a09096474750fb0ff..5964dcc26259ea3e27bc7c0d629a42f0f0d2ebb8 100644 (file)
@@ -54,8 +54,8 @@ int main(int argc,char *argv[])
 
        it=comedi_open(filename);
        if(!it){
-               fprintf(stderr,"cannot open %s: %s\n",filename, strerror(errno));
-               exit(0);
+               comedi_perror(filename);
+               exit(1);
        }
 
        printf("overall info:\n");