changed convention for default calibration file naming to something
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 6 May 2003 00:36:18 +0000 (00:36 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 6 May 2003 00:36:18 +0000 (00:36 +0000)
more transparent and robust (since I figured out how to get minor number
from code for ls)

comedi_calibrate/save_cal.c
lib/calib.c

index 61e9979d90171440374161e4f45dd955d97f0528..6c0b8b27687bcaf244ecafbce93cfc4f8554453b 100644 (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 )
index b22b376f4cd10e6dcd91513db7c19bc9083f0bb3..6e47ef95334478408e0eeae1ea4f2f420b8a38b0 100644 (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" );