From 12eff430e9d20c62fa9cc81d0b6ecface61bac18 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Sep 2014 08:40:06 -0500 Subject: Don't close device handle until after calling flush ioctls, reported by Ashwini Sharma. --- toys/other/nbd_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toys/other/nbd_client.c') diff --git a/toys/other/nbd_client.c b/toys/other/nbd_client.c index 33787d77..6b437c72 100644 --- a/toys/other/nbd_client.c +++ b/toys/other/nbd_client.c @@ -119,10 +119,9 @@ void nbd_client_main(void) if (ioctl(nbd, NBD_DO_IT)>=0 || errno==EBADR) break; close(sock); } - close(nbd); // Flush queue and exit. - ioctl(nbd, NBD_CLEAR_QUE); ioctl(nbd, NBD_CLEAR_SOCK); + if (CFG_TOYBOX_FREE) close(nbd); } -- cgit v1.2.3