From: Frank Mori Hess Date: Thu, 22 Feb 2001 21:48:40 +0000 (+0000) Subject: made comedi_config no longer require a driver name when used to detach a driver X-Git-Tag: r0_7_15~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32c50c353c32f6d7ff42cc807775c153cd40947d;p=comedilib.git made comedi_config no longer require a driver name when used to detach a driver --- diff --git a/comedi_config/comedi_config.c b/comedi_config/comedi_config.c index b3d3ba9..9671446 100644 --- a/comedi_config/comedi_config.c +++ b/comedi_config/comedi_config.c @@ -145,7 +145,7 @@ int main(int argc,char *argv[]) } if((argc-optind) < 1 || (argc-optind) > 3 || - ((argc-optind) == 1 && read_buf_size == 0 && write_buf_size == 0)){ + ((argc-optind) == 1 && read_buf_size == 0 && write_buf_size == 0 && remove == 0)){ do_help(1); } @@ -157,10 +157,13 @@ int main(int argc,char *argv[]) exit(1); } - // if we are attaching a device and not just changing buffer size - if((argc-optind) > 1) + // if we are attaching or detaching a device + if((argc-optind) > 1 || ((argc-optind) == 1 && remove)) { - driver=argv[optind+1]; + if(argc - optind > 1) + driver=argv[optind+1]; + else + driver = "none"; strncpy(it.board_name,driver,COMEDI_NAMELEN-1); for(i=0;i 3) + do_help(1); ret=stat(fn,&statbuf); if(ret<0){