From d6134f6b911daa0ac0e8086a4ab2d146ec8b6e04 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 6 May 2021 09:24:52 +0000 Subject: Clean up scandir after update --- src/s6-rc/s6-rc-update.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c index 7308c5b..eb6104a 100644 --- a/src/s6-rc/s6-rc-update.c +++ b/src/s6-rc/s6-rc-update.c @@ -779,6 +779,19 @@ int main (int argc, char const *const *argv, char const *const *envp) strerr_warni1x("updating s6rc-fdholder pipe storage") ; update_fdholder(&olddb, oldstate, &newdb, newstate, invimage, envp, &deadline) ; + + /* Clean up scandir */ + + if (verbosity >= 2) + strerr_warni1x("cleaning up scan directory") ; + + { + char scdir[livelen + 9] ; + memcpy(scdir, live, livelen) ; + memcpy(scdir + livelen, "/scandir", 9) ; + if (s6_svc_writectl(scdir, S6_SVSCAN_CTLDIR, "an", 2) <= 0) + strerr_warnwu2sys("send command to s6-svscan on ", scdir) ; + } } -- cgit v1.2.3