fn = "/dev/comedi0";
while (1) {
- c = getopt_long(argc, argv, "f:vq", options, &index);
+ c = getopt_long(argc, argv, "fs:vq", options, &index);
if (c == -1)break;
switch (c) {
case 0:
fprintf( file, ",\n" );
}
fprintf( file, "\t],\n"
- "};\n");
+ "}\n");
return 0;
}
struct stat file_stats;
comedi_t *dev = setup->dev;
- if( fstat( comedi_fileno( dev ), &file_stats ) < 0 )
+ if( setup->cal_save_file_path == NULL )
{
- fprintf( stderr, "failed to get file stats of comedi device file\n" );
- return -1;
- }
+ if( fstat( comedi_fileno( dev ), &file_stats ) < 0 )
+ {
+ fprintf( stderr, "failed to get file stats of comedi device file\n" );
+ return -1;
+ }
- snprintf( command, sizeof( command ), "install -d %s", save_dir );
- if( system( command ) )
- {
- fprintf( stderr, "failed to create directory %s\n", save_dir );
- return -1;
- }
+ snprintf( command, sizeof( command ), "install -d %s", save_dir );
+ if( system( command ) )
+ {
+ fprintf( stderr, "failed to create directory %s\n", save_dir );
+ return -1;
+ }
- if( setup->cal_save_file_path == NULL )
- {
asprintf( &setup->cal_save_file_path, "%s/%s_0x%lx",
save_dir, comedi_get_board_name( dev ),
( unsigned long ) file_stats.st_ino );