Improved error handling

This commit is contained in:
Pierre Pronchery 2011-05-13 13:51:50 +00:00
parent 766649530f
commit 56c029e0e9

View File

@ -296,14 +296,21 @@ static gboolean _on_watch_can_read(GIOChannel * source, GIOCondition condition,
fwrite(buf, sizeof(*buf), cnt, stderr); fwrite(buf, sizeof(*buf), cnt, stderr);
fprintf(stderr, "\"\n"); fprintf(stderr, "\"\n");
#endif #endif
switch(entry->command) switch(status)
{ {
case WC_LIST_NETWORKS: case G_IO_STATUS_NORMAL:
ret = _read_list_networks(applet, wpa, buf, cnt); if(entry->command == WC_LIST_NETWORKS)
break; ret = _read_list_networks(applet, wpa, buf,
case WC_STATUS: cnt);
else if(entry->command == WC_STATUS)
ret = _read_status(applet, wpa, buf, cnt); ret = _read_status(applet, wpa, buf, cnt);
break; break;
case G_IO_STATUS_ERROR:
applet->helper->error(applet->helper->panel,
error->message, 1);
case G_IO_STATUS_EOF:
default: /* should not happen... */
break;
} }
if(ret == TRUE) if(ret == TRUE)
return TRUE; return TRUE;