From 67204108ede9634e311701b0317d86f30d86ac5e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 7 Apr 2009 09:41:41 +1000 Subject: [PATCH] check that the umount actually worked and keep running if fusermount returned error by the filesystembeing busy --- migrate/remote-cached.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/migrate/remote-cached.c b/migrate/remote-cached.c index df2538e..cf9cd7a 100644 --- a/migrate/remote-cached.c +++ b/migrate/remote-cached.c @@ -216,9 +216,18 @@ static void migd_sigusr2_handler(struct event_context *ev, struct signal_event * char *cmd; int ret; - cmd = talloc_asprintf(mem_ctx, "fusermount -u %s\n", export); + cmd = talloc_asprintf(mem_ctx, "fusermount -u %s", export); DEBUG(DEBUG_ERR,("Got SIGUSR2, unmounting fuse filesystem %s\n", export)); ret = system(cmd); + if (ret == -1) { + DEBUG(DEBUG_ERR,("system(%s) call failed : %s\n", cmd, strerror(errno))); + return; + } + ret = WEXITSTATUS(ret); + if (ret != 0) { + DEBUG(DEBUG_ERR,("%s failed with return code %d. Umount failed.\n", cmd, ret)); + return; + } talloc_free(mem_ctx); _exit(10); -- 2.34.1