Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad error message if autosave detects a time drift when saving #58

Open
simon-ess opened this issue Feb 15, 2024 · 0 comments
Open

Bad error message if autosave detects a time drift when saving #58

simon-ess opened this issue Feb 15, 2024 · 0 comments

Comments

@simon-ess
Copy link
Contributor

If the time on the filesystem hosting the autosave files differs from the IOC clock, then you get some incorrect error messages:

2024-02-15 15:28:49 save_restore:write_save_file: Can't write save file. [240215-152849]
2024-02-15 15:28:49 save_restore:write_it: file time is different from IOC time [240215-152849], difference=7050.000000s

This is incorrect as the files are actually saved just fine: the problem is that the write_it does the following:

    delta_time = difftime(time(NULL), fileStat.st_mtime);
	if (delta_time > 10.0) {
		printf("save_restore:write_it: file time is different from IOC time [%s], difference=%fs\n",
            datetime, delta_time);
		return(ERROR);
	}

Note the return (ERROR):

	if (write_it(save_file, plist) == ERROR) {
		printf("*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
		printf("save_restore:write_save_file: Can't write save file. [%s]\n", datetime);
		printf("*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");

This means that the file can save correctly, but it reports it as if it did not. The message should probably be updated, or the time difference reduced to a warning or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant