]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
tests/nvme/rc: Modify the approach for disabling and re-enabling Ctrl-C
authorBart Van Assche <bvanassche@acm.org>
Thu, 8 Aug 2019 20:05:03 +0000 (13:05 -0700)
committerOmar Sandoval <osandov@osandov.com>
Wed, 4 Sep 2019 17:49:05 +0000 (10:49 -0700)
Avoid that the following error messages are reported when redirecting stdin:

stty: 'standard input': Inappropriate ioctl for device
stty: 'standard input': Inappropriate ioctl for device

Cc: Logan Gunthorpe <logang@deltatee.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: a987b10bc179 ("nvme: Ensure all ports and subsystems are removed on cleanup")
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
tests/nvme/rc

index d4e18e635dea6379946c0406770966b330bf922d..40f0413d32d2fe2b3a3c2de11d4c1049369cc2ac 100644 (file)
@@ -36,7 +36,7 @@ _cleanup_nvmet() {
        fi
 
        # Don't let successive Ctrl-Cs interrupt the cleanup processes
-       stty -isig
+       trap '' SIGINT
 
        shopt -s nullglob
 
@@ -66,7 +66,7 @@ _cleanup_nvmet() {
        done
 
        shopt -u nullglob
-       stty isig
+       trap SIGINT
 
        modprobe -r nvme-loop 2>/dev/null
        modprobe -r nvmet 2>/dev/null