File-based stats: abort writing if we can't write

There might be a number of reasons, such as read-only write system,
erros, etc. Still gracefully continue instead of aborting the operation.
This commit is contained in:
Robert Schmidt
2025-04-24 17:22:43 +02:00
parent 83dc33d3bf
commit f9224e1fc8
3 changed files with 18 additions and 10 deletions
+5 -3
View File
@@ -267,9 +267,11 @@ void *nrL1_stats_thread(void *param) {
char output[L1STATSSTRLEN];
memset(output,0,L1STATSSTRLEN);
wait_sync("L1_stats_thread");
FILE *fd;
fd=fopen("nrL1_stats.log","w");
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
FILE *fd=fopen("nrL1_stats.log","w");
if (!fd) {
LOG_W(NR_PHY, "Cannot open nrL1_stats.log: %d, %s\n", errno, strerror(errno));
return NULL;
}
reset_meas(&gNB->phy_proc_tx);
reset_meas(&gNB->dlsch_encoding_stats);