git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ccdb28b
)
inspection: Return root devices sorted.
author
Richard W.M. Jones
<rjones@redhat.com>
Wed, 19 Oct 2011 14:43:37 +0000
(15:43 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Wed, 19 Oct 2011 17:37:20 +0000
(18:37 +0100)
(cherry picked from commit
c46bedf925cd9c6c9a9cbaee115358fd1dffcbfe
)
src/inspect.c
patch
|
blob
|
history
diff --git
a/src/inspect.c
b/src/inspect.c
index
c51804d
..
ba3e5de
100644
(file)
--- a/
src/inspect.c
+++ b/
src/inspect.c
@@
-123,6
+123,15
@@
guestfs__inspect_os (guestfs_h *g)
return ret;
}
+static int
+compare_strings (const void *vp1, const void *vp2)
+{
+ const char *s1 = * (char * const *) vp1;
+ const char *s2 = * (char * const *) vp2;
+
+ return strcmp (s1, s2);
+}
+
char **
guestfs__inspect_get_roots (guestfs_h *g)
{
@@
-151,6
+160,8
@@
guestfs__inspect_get_roots (guestfs_h *g)
}
ret[count] = NULL;
+ qsort (ret, count, sizeof (char *), compare_strings);
+
return ret;
}