From: Frank Mori Hess Date: Fri, 9 May 2003 00:00:51 +0000 (+0000) Subject: added driver name to default calibration file path X-Git-Tag: r0_7_21~155 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4c95630d224a1d648044d45e75a69a3393ba3d0f;p=comedilib.git added driver name to default calibration file path --- diff --git a/lib/calib.c b/lib/calib.c index b53a65d..e9beffa 100644 --- a/lib/calib.c +++ b/lib/calib.c @@ -167,6 +167,7 @@ char* comedi_get_default_calibration_path( comedi_t *dev ) struct stat file_stats; char *file_path; char *board_name; + char *driver_name; if( fstat( comedi_fileno( dev ), &file_stats ) < 0 ) { @@ -179,8 +180,13 @@ char* comedi_get_default_calibration_path( comedi_t *dev ) { return NULL; } - asprintf( &file_path, "/etc/comedi/calibrations/%s_comedi%li", - board_name, ( unsigned long ) minor( file_stats.st_rdev ) ); + driver_name = comedi_get_driver_name( dev ); + if( driver_name == NULL ) + { + return NULL; + } + asprintf( &file_path, "/etc/comedi/calibrations/%s_%s_comedi%li", + driver_name, board_name, ( unsigned long ) minor( file_stats.st_rdev ) ); return file_path; }