This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch feature/674-use-properties-type-in-filter
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/674-use-properties-type-in-filter by this push:
new ab90435c Update fclose error injection, so that files are always
closed.
ab90435c is described below
commit ab90435c41801719638b3692d444994856919db0
Author: Pepijn Noltes <[email protected]>
AuthorDate: Wed Nov 29 19:42:40 2023 +0100
Update fclose error injection, so that files are always closed.
---
libs/error_injector/stdio/src/stdio_ei.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libs/error_injector/stdio/src/stdio_ei.cc
b/libs/error_injector/stdio/src/stdio_ei.cc
index 42f033fd..d78f7bbc 100644
--- a/libs/error_injector/stdio/src/stdio_ei.cc
+++ b/libs/error_injector/stdio/src/stdio_ei.cc
@@ -101,8 +101,11 @@ int __wrap_fputs(const char* __s, FILE* __stream) {
int __real_fclose(FILE* __stream);
CELIX_EI_DEFINE(fclose, int)
int __wrap_fclose(FILE* __stream) {
+ int rc = __real_fclose(__stream); //note always call real fclose to ensure
the stream is closed.
+ errno = ENOSPC;
CELIX_EI_IMPL(fclose);
- return __real_fclose(__stream);
+ errno = 0;
+ return rc;
}
}