From 887421ecc5247aaaddcf1f57706cb332bb9b1b64 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 2 Feb 2011 22:40:12 +0000 Subject: [PATCH] Commands entered from plug-ins now default to a timeout of 30 seconds --- src/phone.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/phone.c b/src/phone.c index e32d0d9..6ed0a46 100644 --- a/src/phone.c +++ b/src/phone.c @@ -2948,7 +2948,15 @@ static void _phone_progress_pulse(GtkWidget * widget) /* phone_queue */ static int _phone_queue(Phone * phone, char const * command) { - return (gsm_queue(phone->gsm, command) != NULL) ? 0 : 1; + GSMCommand * c; + + if((c = gsm_command_new(command)) == NULL) + return -1; + gsm_command_set_timeout(c, 30000); + if(gsm_queue_command(phone->gsm, c) == 0) + return 0; + gsm_command_delete(c); + return -1; }