Skip to content

Commit

Permalink
attr: Sort attributes after adding new ones
Browse files Browse the repository at this point in the history
Sort attributes as soon as a new one has been added.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei authored and mhennerich committed Mar 11, 2024
1 parent e3d4c9f commit 28e2608
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 @@ -7,6 +7,7 @@
*/

#include "iio-private.h"
#include "sort.h"

#include <inttypes.h>
#include <errno.h>
Expand Down Expand Up @@ -214,6 +215,8 @@ int iio_add_attr(union iio_pointer p, struct iio_attr_list *attrs,

attrs->num++;

iio_sort_attrs(attrs);

return 0;
}

Expand Down

0 comments on commit 28e2608

Please sign in to comment.