-
Notifications
You must be signed in to change notification settings - Fork 4.9k
enh: simulate random i/o error #27155
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
Conversation
@@ -64,6 +64,20 @@ typedef struct TdFile { | |||
|
|||
#define FILE_WITH_LOCK 1 | |||
|
|||
#ifdef BUILD_WITH_RAND_ERR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类似这样的宏潘魏应该已经加过了,不需要重复加,只要在特定地方用它就行了。如果觉得他的宏名字起得不够通用,可以把名字改得通用一些。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
潘魏暂未定义类似的宏;资源类的随机失败常见的也就是内存和文件;如果要增加公共宏,可以放在 tutil.h 或是 tdef.h,而 tutil.h 引用了其他头文件,因此在使用 tutil.h 时会引入一些新的头文件,tdef.h 基本是一些常量类型的定义,所以两个位置都感觉不是很好。基于以上几点,暂未增加公用的宏,如果以后还要继续增加其他类型的资源随机失败,再考虑将 osFile.c/osMemory.c 的定义提取出来。
No description provided.