From 3c8c0b219d3d926a32480149acdf37c8950e9406 Mon Sep 17 00:00:00 2001 From: Matthew LeVan Date: Wed, 12 Jul 2023 12:05:50 -0400 Subject: [PATCH] disk: fix migrate scenarios --- pkg/vere/disk.c | 4 ++-- pkg/vere/main.c | 3 --- pkg/vere/pier.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/vere/disk.c b/pkg/vere/disk.c index cc07da2827..f87ce92154 100644 --- a/pkg/vere/disk.c +++ b/pkg/vere/disk.c @@ -1310,8 +1310,8 @@ u3_disk_need_migrate(u3_disk* log_u) c3_c dut_c[8193]; snprintf(dut_c, sizeof(dut_c), "%s/data.mdb", log_u->com_u->pax_c); if ( !_(u3_Host.ops_u.nuu) - && 0 != access(dut_c, R_OK) ) { - // if .urb/log/data.mdb is not readable, skip migration + && 0 != access(dut_c, F_OK) ) { + // if .urb/log/data.mdb does not exist, skip migration return c3n; } diff --git a/pkg/vere/main.c b/pkg/vere/main.c index 5cc44e0cfa..b09ccdd346 100644 --- a/pkg/vere/main.c +++ b/pkg/vere/main.c @@ -2153,9 +2153,6 @@ _cw_play_exit(c3_i int_i) static void _cw_play_impl(c3_d eve_d, c3_d sap_d, c3_o mel_o, c3_o sof_o, c3_o ful_o) { - // XX factor this into its own function for calling here and - // from main() (urbit play and boot replay) - // XX handle SIGTSTP so that the lockfile is not orphaned? // u3_disk* log_u; diff --git a/pkg/vere/pier.c b/pkg/vere/pier.c index 44e9ee4d35..830a2c1e49 100644 --- a/pkg/vere/pier.c +++ b/pkg/vere/pier.c @@ -1645,7 +1645,7 @@ _pier_init(c3_w wag_w, c3_c* pax_c) .write_bail_f = _pier_on_disk_write_bail }; - if ( !(pir_u->log_u = u3_disk_init(pax_c, cb_u, c3n)) ) { + if ( !(pir_u->log_u = u3_disk_init(pax_c, cb_u, c3y)) ) { c3_free(pir_u); return 0; }