From 72caad4526addb756c9d1f57787d6a144b940f78 Mon Sep 17 00:00:00 2001 From: senthil Date: Wed, 12 Nov 2014 16:15:53 -0500 Subject: [PATCH] Allow timeout for download and run --- ios-deploy.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ios-deploy.c b/ios-deploy.c index eaba69e..f5252bb 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -1602,7 +1602,22 @@ void timeout_callback(CFRunLoopTimerRef timer, void *info) { } else { - printf("[....] No more devices found.\n"); + if (!debug) + printf("[....] No more devices found.\n"); + else + { + int mypid = getpid(); + if ((parent != 0) && (parent == mypid) && (child != 0)) + { + //we shouldn't be here because it is the parent + //just in case. + if (verbose) + { + printf("Timeout. Killing child (%d) tree\n", child); + } + kill_ptree(child, SIGHUP); + } + } exit(0); } }