From d5ea98f55b49b0331c462e4919a4907491c1a9d8 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 6 May 2003 00:36:18 +0000 Subject: [PATCH] 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) --- comedi_calibrate/save_cal.c | 4 ++-- lib/calib.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/comedi_calibrate/save_cal.c b/comedi_calibrate/save_cal.c index 61e9979..6c0b8b2 100644 --- a/comedi_calibrate/save_cal.c +++ b/comedi_calibrate/save_cal.c @@ -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 ) diff --git a/lib/calib.c b/lib/calib.c index b22b376..6e47ef9 100644 --- a/lib/calib.c +++ b/lib/calib.c @@ -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" ); -- 2.26.2