summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlex Dowad <alexinbeijing@gmail.com>2015-05-19 20:15:15 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-05-26 08:38:45 +0300
commit4c3712ecb443a141227265ecc4394104a1b15801 (patch)
treec0ce3c848bccec0220558e390bc5b45cf18c9c33 /Makefile
parentc6d273fc34605ed5655a36fda2e35d0a2d85969b (diff)
downloadapk-tools-4c3712ecb443a141227265ecc4394104a1b15801.tar.gz
apk-tools-4c3712ecb443a141227265ecc4394104a1b15801.tar.bz2
apk-tools-4c3712ecb443a141227265ecc4394104a1b15801.tar.xz
apk-tools-4c3712ecb443a141227265ecc4394104a1b15801.zip
detect failures in writing to file during final flush of buffers
In practice this should fix to e.g. not wipe out /etc/apk/world if final flush to /etc/apk/world.new fails. This was prompted by an incident the other day where I ran the root partition of an Alpine box out of space using 'apk add', and apk helpfully wiped the contents of /etc/apk/world at the same time. It might be tricky to try to reproduce exactly the same failure, but from an examination of the code, setting 'rc' before the final call to fdo_flush rather than after is one possible cause of this behavior. (If the entire contents of /etc/apk/world.new are buffered, and all get written out in the final fdo_flush call, and that call fails, fdo_close will still happily rename /etc/apk/world.new to /etc/apk/world.)
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions