diff options
author | Yao Chen <yaochen@google.com> | 2018-11-08 15:32:17 -0800 |
---|---|---|
committer | Yao Chen <yaochen@google.com> | 2018-11-09 09:56:36 -0800 |
commit | 39b679925aaeb47fdf5bd39f9afbd4025be79a44 (patch) | |
tree | c4e0a0e8fb2353ef140a1a866cb34f43e430560f /tools/stats_log_api_gen/main.cpp | |
parent | 306406790868def006d6cebf4c4b2830e73916aa (diff) |
Pass the last error code when statslog.write fails
The error code will give us some clue on what caused the loss (e.g., EBUSY, or ENOENT)
Test: manual
Bug: 80538532
Change-Id: I446c6e2255bdae063dfb8803ad0b702ead87c645
Diffstat (limited to 'tools/stats_log_api_gen/main.cpp')
-rw-r--r-- | tools/stats_log_api_gen/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/stats_log_api_gen/main.cpp b/tools/stats_log_api_gen/main.cpp index 1ef34b9c22eb..8585ae9f3f61 100644 --- a/tools/stats_log_api_gen/main.cpp +++ b/tools/stats_log_api_gen/main.cpp @@ -435,7 +435,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms, fprintf(out, " std::this_thread::sleep_for(std::chrono::milliseconds(10));\n"); fprintf(out, " }\n"); fprintf(out, " if (ret < 0) {\n"); - fprintf(out, " note_log_drop();\n"); + fprintf(out, " note_log_drop(ret);\n"); fprintf(out, " }\n"); fprintf(out, " return ret;\n"); fprintf(out, "}\n"); @@ -528,7 +528,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms, fprintf(out, " std::this_thread::sleep_for(std::chrono::milliseconds(10));\n"); fprintf(out, " }\n"); fprintf(out, " if (ret < 0) {\n"); - fprintf(out, " note_log_drop();\n"); + fprintf(out, " note_log_drop(ret);\n"); fprintf(out, " }\n"); fprintf(out, " return ret;\n\n"); fprintf(out, "}\n"); |