mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
!614 merge master into master
fix syscap_define_custom.h incremental generation Created-by: hosted Commit-by: hosted Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/developtools_syscap_codec/issues/342?ref=&did=3643142#tid-3643142 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 NA * 3.4 其他技术优化内容(做了什么,变更了什么) 使用`os.open`打开文件时,当文件存在时,未指定`os.O_TRUNC`标志位,旧内容不会被清空,容易产生尾部残留数据,导致隐蔽且严重的错误。 如果文件已存在且新写入内容比旧内容短,会导致文件尾部残留旧数据。 修改增加了`os.O_TRUNC`标志位,若文件已存在, 在写入前先清空文件内容 * 3.5 废弃通知(什么字段、方法弃用?) NA * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) NA ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/developtools_syscap_codec!614
This commit is contained in:
@@ -152,6 +152,6 @@ if __name__ == '__main__':
|
||||
output_file = args.output
|
||||
|
||||
full = assemble_header_file(base_file, extern_file)
|
||||
with os.fdopen(os.open(output_file, os.O_WRONLY | os.O_CREAT, mode=0o640), 'w') as out:
|
||||
with os.fdopen(os.open(output_file, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, mode=0o640), 'w') as out:
|
||||
out.writelines(full)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user