From 0496aeffc6fd7938a694f879a1eaadc73a1b7343 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 14 Dec 2023 15:40:13 +0100 Subject: [PATCH] Close stream FD on ovni_thread_free() This is required on FS like NFS as the cache coherence model states that only after the file is closed the changes are actually propagated to the server. It is not recomended to use NFS as OVNI_TMPDIR anyway. Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/168 --- CHANGELOG.md | 4 ++++ src/rt/ovni.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 190f899..7b72147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Emulation models now have a semantic version (X.Y.Z) instead of just a number. - Install ovniver with the runpath set. +### Fixed + +- Close stream FD on `ovni_thread_free()`. + ## [1.4.1] - 2023-11-16 ### Changed diff --git a/src/rt/ovni.c b/src/rt/ovni.c index 1ffe7f0..1691bcf 100644 --- a/src/rt/ovni.c +++ b/src/rt/ovni.c @@ -593,6 +593,10 @@ ovni_thread_free(void) thread_metadata_store(); free(rthread.evbuf); + rthread.evbuf = NULL; + + close(rthread.streamfd); + rthread.streamfd = -1; } int