changed convention for default calibration file naming to something

more transparent and robust (since I figured out how to get minor number
from code for ls)
This commit is contained in:
Frank Mori Hess 2003-05-06 00:36:18 +00:00
parent 4172580d89
commit d5ea98f55b
2 changed files with 4 additions and 4 deletions

View file

@ -140,9 +140,9 @@ int write_calibration_file( calibration_setup_t *setup, saved_calibration_t sett
return -1;
}
asprintf( &setup->cal_save_file_path, "%s/%s_0x%lx",
asprintf( &setup->cal_save_file_path, "%s/%s_comedi%li",
save_dir, comedi_get_board_name( dev ),
( unsigned long ) file_stats.st_ino );
( unsigned long ) minor( file_stats.st_rdev ) );
}
file = fopen( setup->cal_save_file_path, "w" );
if( file == NULL )

View file

@ -169,9 +169,9 @@ int comedi_apply_calibration( comedi_t *dev, unsigned int subdev, unsigned int c
return -1;
}
snprintf( file_path, sizeof( file_path ), "/etc/comedi/calibrations/%s_0x%lx",
snprintf( file_path, sizeof( file_path ), "/etc/comedi/calibrations/%s_comedi%li",
comedi_get_board_name( dev ),
( unsigned long ) file_stats.st_ino );
( unsigned long ) minor( file_stats.st_rdev ) );
}
cal_file = fopen( file_path, "r" );