Signed-off-by: langfei <langfei@huawei.com> (cherry picked from commit 932ebb5b1d1eb8ca9cdf61de0f1e356577f588a8)
32 lines
957 B
Diff
32 lines
957 B
Diff
From 8d7c78304fb994a519e2709024b196841e84238a Mon Sep 17 00:00:00 2001
|
|
From: Robert Malz <robert.malz@canonical.com>
|
|
Date: Thu, 14 Mar 2024 13:36:15 +0100
|
|
Subject: [PATCH] Flush file before closing
|
|
|
|
After writing to file, before closing, flush is required.
|
|
Without it fclose can randomly return IO error.
|
|
|
|
Signed-off-by: Robert Malz <robert.malz@canonical.com>
|
|
|
|
Reference:https://github.com/Irqbalance/irqbalance/commit/8d7c78304fb994a519e2709024b196841e84238a
|
|
Conflict:NA
|
|
---
|
|
activate.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/activate.c b/activate.c
|
|
index d3f99f7..e30d0f0 100644
|
|
--- a/activate.c
|
|
+++ b/activate.c
|
|
@@ -82,6 +82,7 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
|
|
cpumask_scnprintf(buf, PATH_MAX, applied_mask);
|
|
ret = fprintf(file, "%s", buf);
|
|
errsave = errno;
|
|
+ fflush(file);
|
|
if (fclose(file)) {
|
|
errsave = errno;
|
|
goto error;
|
|
--
|
|
2.28.0.windows.1
|
|
|