projects
/
platform
/
upstream
/
gummiboot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5897db4
)
setup: flush file to disk, before updating its timestamps
author
Lennart Poettering
<lennart@poettering.net>
Tue, 12 Feb 2013 18:04:47 +0000
(19:04 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 12 Feb 2013 18:11:41 +0000
(19:11 +0100)
setup.c
patch
|
blob
|
history
diff --git
a/setup.c
b/setup.c
index
3808653
..
fd01d33
100644
(file)
--- a/
setup.c
+++ b/
setup.c
@@
-564,6
+564,13
@@
static int copy_file(const char *from, const char *to) {
}
} while (!feof(f));
+ fflush(g);
+ if (ferror(g)) {
+ fprintf(stderr, "Failed to write %s: %m\n", to);
+ r = -errno;
+ goto finish;
+ }
+
r = fstat(fileno(f), &st);
if (r < 0) {
fprintf(stderr, "Failed to get file timestamps of %s: %m", from);