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
diff --git a/stats/stats_log_api_gen/main.cpp b/stats/stats_log_api_gen/main.cpp
index 1ef34b9..8585ae9 100644
--- a/stats/stats_log_api_gen/main.cpp
+++ b/stats/stats_log_api_gen/main.cpp
@@ -435,7 +435,7 @@
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 @@
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");