From: Kees Jongenburger Date: Wed, 13 Feb 2013 16:54:40 +0000 (+0100) Subject: mmc:Ignore SIGTERM if open count > 0 X-Git-Tag: v3.2.1~4 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F328%2F2;p=minix.git mmc:Ignore SIGTERM if open count > 0 Change-Id: I996497335b4209ff7ef95dfa977d97e5557456e9 --- diff --git a/drivers/mmc/mmcblk.c b/drivers/mmc/mmcblk.c index d2da50a3f..e2ed76b9c 100644 --- a/drivers/mmc/mmcblk.c +++ b/drivers/mmc/mmcblk.c @@ -8,7 +8,6 @@ #include #include - /* system headers */ #include /* disk IOCTL's */ @@ -595,12 +594,25 @@ block_system_event_cb(int type, sef_init_info_t * info) static void block_signal_handler_cb(int signo) { + struct sd_slot *slot; + mmc_log_debug(&log, "System event framework signal handler sig(%d)\n", signo); /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; - // FIXME shutdown + + /* we only have a single slot and need an open count idealy we should + * iterate over the card to determine the open count */ + slot = get_slot(0); + assert(slot); + if (slot->card.open_ct > 0) { + mmc_log_debug(&log, "Not responding to SIGTERM (open count=%d)\n", + slot->card.open_ct); + return; + } + + mmc_log_info(&log, "MMC driver exit"); exit(0); }