I'd get rid of the local var 'ret', and just check the return value of g_ril_send() against 0.