This should hopefully reduce local db corruption issues.
Signed-off-by: Allan McRae <allan@archlinux.org> --- lib/libalpm/be_local.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 4574bd4..cb12abb 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -841,6 +841,7 @@ int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) fprintf(fp, "\n"); }
+ fdatasync(fileno(fp)); fclose(fp); fp = NULL; } @@ -869,6 +870,8 @@ int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } fprintf(fp, "\n"); } + + fdatasync(fileno(fp)); fclose(fp); fp = NULL; }
Wouldn't this cause a notable slow-down? NG