bug fixes

This commit is contained in:
Philip C Monk 2015-06-18 15:56:11 -04:00
parent 981c824af3
commit 932273b120
3 changed files with 13 additions and 11 deletions

View File

@ -989,7 +989,7 @@
/* u3_unix_ef_look(): update filesystem from unix /* u3_unix_ef_look(): update filesystem from unix
*/ */
void void
u3_unix_ef_look(void); u3_unix_ef_look(u3_noun all);
/* u3_unix_ef_ergo(): update filesystem from urbit /* u3_unix_ef_ergo(): update filesystem from urbit
*/ */

View File

@ -460,7 +460,7 @@ u3_lo_shut(c3_o inn)
// XX remove raty_lead guard // XX remove raty_lead guard
// //
if ( c3y == inn ) { if ( c3y == inn ) {
u3_unix_ef_look(); u3_unix_ef_look(c3n);
u3_raft_work(); u3_raft_work();
_lo_time(); _lo_time();
} }
@ -678,7 +678,7 @@ u3_lo_lead(void)
_lo_talk(); _lo_talk();
{ {
u3_unix_ef_look(); u3_unix_ef_look(c3n);
u3v_plan(u3nt(u3_blip, c3__ames, u3_nul), u3v_plan(u3nt(u3_blip, c3__ames, u3_nul),
u3nc(c3__kick, u3k(u3A->now))); u3nc(c3__kick, u3k(u3A->now)));
} }

View File

@ -2,11 +2,11 @@
// XXX i suspect maybe a problem if there's untrackable files in // XXX i suspect maybe a problem if there's untrackable files in
// a directory when we try to delete it? // a directory when we try to delete it?
// XXX probably should allow out-only mount points // XXX probably should allow out-only mount points
// XXX fix naked file -- currently just does file.root
// XXX maybe get rid of mim.u.dok cache? // XXX maybe get rid of mim.u.dok cache?
// XXX what happens if we delete a directory? // XXX what happens if we delete a directory?
// XXX shouldn't "all.h" be defined first so that _GNU_SOURCE // XXX shouldn't "all.h" be defined first so that _GNU_SOURCE
// is defined everywhere? // is defined everywhere?
// XXX fix naked file -- currently just does file.root
// XXX deleted files while the pier is down doesn't propogate // XXX deleted files while the pier is down doesn't propogate
/* v/unix.c /* v/unix.c
** **
@ -732,6 +732,7 @@ _unix_update_dir(u3_udir* dir_u)
c3_assert( c3y == dir_u->dir ); c3_assert( c3y == dir_u->dir );
if ( c3y == dir_u->dry ) { if ( c3y == dir_u->dry ) {
uL(fprintf(uH, "directory dry, why bother? %s\r\n", dir_u->pax_c));
return u3_nul; return u3_nul;
} }
@ -798,6 +799,7 @@ _unix_update_dir(u3_udir* dir_u)
} }
while ( 1 ) { while ( 1 ) {
uL(fprintf(uH, "checking for new node in %s\r\n", dir_u->pax_c));
struct dirent ent_u; struct dirent ent_u;
struct dirent* out_u; struct dirent* out_u;
c3_w err_w; c3_w err_w;
@ -860,7 +862,7 @@ _unix_update_dir(u3_udir* dir_u)
else { else {
u3_udir* dis_u = c3_malloc(sizeof(u3_udir)); u3_udir* dis_u = c3_malloc(sizeof(u3_udir));
_unix_watch_dir(dis_u, dir_u, pax_c); _unix_watch_dir(dis_u, dir_u, pax_c);
_unix_update_dir(dis_u); can = u3kb_weld(_unix_update_dir(dis_u), can);
} }
} }
} }
@ -899,12 +901,12 @@ _unix_update_node(u3_unod* nod_u)
/* _unix_update_mount(): update mount point /* _unix_update_mount(): update mount point
*/ */
static void static void
_unix_update_mount(u3_umon* mon_u) _unix_update_mount(u3_umon* mon_u, u3_noun all)
{ {
if ( c3n == mon_u->dir_u.dry ) { if ( c3n == mon_u->dir_u.dry ) {
u3_noun can = _unix_update_dir(&mon_u->dir_u); u3_noun can = _unix_update_dir(&mon_u->dir_u);
u3v_plan(u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul), u3v_plan(u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul),
u3nt(c3__into, u3i_string(mon_u->nam_c), can)); u3nq(c3__into, u3i_string(mon_u->nam_c), all, can));
} }
} }
@ -1224,7 +1226,7 @@ u3_unix_ef_hill(u3_noun hil)
_unix_get_mount_point(u3h(mon)); _unix_get_mount_point(u3h(mon));
} }
u3_Host.unx_u.dyr = c3y; u3_Host.unx_u.dyr = c3y;
u3_unix_ef_look(); u3_unix_ef_look(c3y);
} }
/* u3_unix_io_init(): initialize unix sync. /* u3_unix_io_init(): initialize unix sync.
@ -1390,20 +1392,20 @@ u3_unix_ef_initial_into()
free(pax_c); free(pax_c);
u3v_plan(u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul), u3v_plan(u3nq(u3_blip, c3__sync, u3k(u3A->sen), u3_nul),
u3nt(c3__into, u3_nul, can)); u3nq(c3__into, u3_nul, c3y, can));
} }
/* u3_unix_ef_look(): update the root. /* u3_unix_ef_look(): update the root.
*/ */
void void
u3_unix_ef_look(void) u3_unix_ef_look(u3_noun all)
{ {
if ( c3y == u3_Host.unx_u.dyr ) { if ( c3y == u3_Host.unx_u.dyr ) {
u3_Host.unx_u.dyr = c3n; u3_Host.unx_u.dyr = c3n;
u3_umon* mon_u; u3_umon* mon_u;
for ( mon_u = u3_Host.unx_u.mon_u; mon_u; mon_u = mon_u->nex_u ) { for ( mon_u = u3_Host.unx_u.mon_u; mon_u; mon_u = mon_u->nex_u ) {
_unix_update_mount(mon_u); _unix_update_mount(mon_u, all);
} }
} }
} }