From 4c95630d224a1d648044d45e75a69a3393ba3d0f Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 9 May 2003 00:00:51 +0000 Subject: [PATCH] added driver name to default calibration file path --- lib/calib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; } -- 2.26.2