Skip to content

Commit

Permalink
Add scandir error check to avoid excess warnings
Browse files Browse the repository at this point in the history
Function uio_list_attr calls scandir() with /attr/ ammended to uio
device path. In file systems without this directory lsuio returns a
warning message for each uio device resulting in additional unnecessary
output to console.

Signed-off-by: Tomas McMonigal <[email protected]>
  • Loading branch information
AnakinSkywalker5 authored and sephalon committed Aug 16, 2021
1 parent 7c18f2b commit fcea3ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ char **uio_list_attr (struct uio_info_t* info)
nr = scandir (path, &namelist, 0, alphasort);
if (nr < 0)
{
if (ENOENT == errno){
return NULL;
}
g_warning (_("scandir: %s"), g_strerror (errno));
return NULL;
}
Expand Down

0 comments on commit fcea3ed

Please sign in to comment.