aboutsummaryrefslogtreecommitdiff
path: root/toys/android/getprop.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-05-03 15:31:41 -0500
committerRob Landley <rob@landley.net>2015-05-03 15:31:41 -0500
commit2a7727dec265fa96e8522b0a557b72320d2889a7 (patch)
tree7efffa13f73a3b921f61477bbe126b3872d11872 /toys/android/getprop.c
parentfcd2729305888d0d8e4af2e6d158b9bbb97541af (diff)
downloadtoybox-2a7727dec265fa96e8522b0a557b72320d2889a7.tar.gz
Fix getprop sorting and error reporting.
Use qstrcmp instead of alphasort (which expects struct dirent arguments). Don't use perror_exit because property_list doesn't set errno.
Diffstat (limited to 'toys/android/getprop.c')
-rw-r--r--toys/android/getprop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/android/getprop.c b/toys/android/getprop.c
index 400d80e7..09bb0f0b 100644
--- a/toys/android/getprop.c
+++ b/toys/android/getprop.c
@@ -40,8 +40,8 @@ void getprop_main(void)
} else {
size_t i;
- if (property_list((void *)add_property, 0)) perror_exit("property_list");
- qsort(TT.nv, TT.size, 2*sizeof(char *), alphasort);
+ if (property_list((void *)add_property, 0)) error_exit("property_list");
+ qsort(TT.nv, TT.size, 2*sizeof(char *), qstrcmp);
for (i = 0; i<TT.size; i++) printf("[%s]: [%s]\n", TT.nv[i*2],TT.nv[1+i*2]);
if (CFG_TOYBOX_FREE) free(TT.nv);
}