mirror of
https://github.com/vale981/yabar
synced 2025-03-04 17:11:38 -05:00
More graceful error handling for ya_wifi internal block
In case the wireless connection was not yet established or has been lost, the block should not immediately fall into an error state and exit. Rather, print a warning message and keep trying...
This commit is contained in:
parent
d682dd6c8d
commit
96714d0025
1 changed files with 6 additions and 5 deletions
|
@ -734,13 +734,14 @@ void ya_int_wifi(ya_block_t *blk) {
|
|||
|
||||
while(1) {
|
||||
if (ya_int_get_wireless_info(&ws, blk->internal->option[0]) || ws.link_qual_max == 0) {
|
||||
ya_block_error(blk, "Failed to retrieve wireless info for device %s", blk->internal->option[0]);
|
||||
ya_block_warning(blk, "Failed to retrieve wireless info for device %s", blk->internal->option[0]);
|
||||
sprintf(startstr, "- (0%%)");
|
||||
} else {
|
||||
sprintf(startstr, "%s (%d%%)", ws.essid, ws.link_qual*100 / ws.link_qual_max);
|
||||
if(suflen)
|
||||
strcat(blk->buf, blk->internal->suffix);
|
||||
}
|
||||
|
||||
sprintf(startstr, "%s (%d%%)", ws.essid, ws.link_qual*100 / ws.link_qual_max);
|
||||
if(suflen)
|
||||
strcat(blk->buf, blk->internal->suffix);
|
||||
|
||||
ya_draw_pango_text(blk);
|
||||
sleep(blk->sleep);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue