Commit 16dccf89c0b6be6e34d16127262cef16f16886b0
1 parent
db2a8fd7
Exists in
master
and in
5 other branches
Pequenas correções no módulo rexx
Showing
1 changed file
with
20 additions
and
12 deletions
Show diff stats
src/plugins/rx3270/remote.cc
... | ... | @@ -254,8 +254,6 @@ remote::remote(const char *name) |
254 | 254 | if(!conn) |
255 | 255 | { |
256 | 256 | log("%s", "DBUS Connection failed"); |
257 | - dbus_connection_close(conn); | |
258 | - conn = NULL; | |
259 | 257 | return; |
260 | 258 | } |
261 | 259 | |
... | ... | @@ -265,12 +263,13 @@ remote::remote(const char *name) |
265 | 263 | { |
266 | 264 | log("Name Error (%s)", err.message); |
267 | 265 | dbus_error_free(&err); |
266 | + conn = NULL; | |
267 | + return; | |
268 | 268 | } |
269 | 269 | |
270 | 270 | if(rc != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) |
271 | 271 | { |
272 | 272 | log("%s", "DBUS request name failed"); |
273 | - dbus_connection_close(conn); | |
274 | 273 | conn = NULL; |
275 | 274 | return; |
276 | 275 | } |
... | ... | @@ -309,13 +308,13 @@ DBusMessage * remote::call(DBusMessage *msg) |
309 | 308 | reply = dbus_connection_send_with_reply_and_block(conn,msg,10000,&error); |
310 | 309 | dbus_message_unref(msg); |
311 | 310 | |
312 | - if(reply) | |
313 | - return reply; | |
314 | - | |
315 | - log("%s",error.message); | |
316 | - dbus_error_free(&error); | |
311 | + if(!reply) | |
312 | + { | |
313 | + log("%s",error.message); | |
314 | + dbus_error_free(&error); | |
315 | + } | |
317 | 316 | |
318 | - return NULL; | |
317 | + return reply; | |
319 | 318 | |
320 | 319 | } |
321 | 320 | |
... | ... | @@ -338,7 +337,7 @@ char * get_string(DBusMessage * msg) |
338 | 337 | #ifdef DEBUG |
339 | 338 | else |
340 | 339 | { |
341 | - trace("Arg type is %c, expecting %c",dbus_message_iter_get_arg_type(&iter),DBUS_TYPE_STRING); | |
340 | + trace("Return type is %c, expecting %c",dbus_message_iter_get_arg_type(&iter),DBUS_TYPE_STRING); | |
342 | 341 | } |
343 | 342 | #endif |
344 | 343 | } |
... | ... | @@ -371,6 +370,12 @@ int get_intval(DBusMessage * msg) |
371 | 370 | dbus_message_iter_get_basic(&iter, &iSigned); |
372 | 371 | rc = (int) iSigned; |
373 | 372 | } |
373 | +#ifdef DEBUG | |
374 | + else | |
375 | + { | |
376 | + trace("Return type is %c, expecting %c",dbus_message_iter_get_arg_type(&iter),DBUS_TYPE_INT32); | |
377 | + } | |
378 | +#endif | |
374 | 379 | } |
375 | 380 | |
376 | 381 | dbus_message_unref(msg); |
... | ... | @@ -619,6 +624,7 @@ int remote::wait_for_ready(int seconds) |
619 | 624 | |
620 | 625 | } |
621 | 626 | |
627 | + return -1; | |
622 | 628 | |
623 | 629 | #elif defined(HAVE_DBUS) |
624 | 630 | |
... | ... | @@ -642,12 +648,14 @@ int remote::wait_for_ready(int seconds) |
642 | 648 | return rc; |
643 | 649 | } |
644 | 650 | |
645 | - | |
646 | 651 | return ETIMEDOUT; |
647 | 652 | |
648 | -#endif | |
653 | +#else | |
649 | 654 | |
650 | 655 | return -1; |
656 | + | |
657 | +#endif | |
658 | + | |
651 | 659 | } |
652 | 660 | |
653 | 661 | char * remote::get_text_at(int row, int col, size_t sz) | ... | ... |