kmod/bugfix-kmod-20-8-depmod-Don-t-unlinkat-orig-depfile-and-add-fsync.patch
2020-04-24 16:12:38 +08:00

38 lines
797 B
Diff

From 0f3d89015caf91ea96359ba7e2afd2aa8ab67e85 Mon Sep 17 00:00:00 2001
From: guoxiaoqi <guoxiaoqi2@huawei.com>
Date: Fri, 25 Jan 2019 17:03:05 +0000
Subject: [PATCH] ok
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
---
tools/depmod.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/depmod.c b/tools/depmod.c
index fbbce10..01db7ad 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2529,6 +2529,7 @@ static int depmod_output(struct depmod *depmod, FILE *out)
if (fp == out)
continue;
+ fsync(fileno(fp));
ferr = ferror(fp) | fclose(fp);
if (r < 0) {
@@ -2556,8 +2557,10 @@ static int depmod_output(struct depmod *depmod, FILE *out)
}
}
- if (dfd >= 0)
+ if (dfd >= 0) {
+ fsync(dfd);
close(dfd);
+ }
return err;
}
--
2.19.1