OSDN Git Service

Merge remote-tracking branch 'toybox/master' into HEAD am: f353b240a5
[android-x86/external-toybox.git] / lib / password.c
index 9654d42..eab2d66 100644 (file)
@@ -1,6 +1,8 @@
 /* password.c - password read/update helper functions.
  *
  * Copyright 2012 Ashwini Kumar <ak.ashwini@gmail.com>
+ *
+ * TODO: cleanup
  */
 
 #include "toys.h"
@@ -22,7 +24,7 @@ int get_salt(char *salt, char *algo)
       if (al[i].id) s += sprintf(s, "$%c$", '0'+al[i].id);
 
       // Read appropriate number of random bytes for salt
-      i = xopen("/dev/urandom", O_RDONLY);
+      i = xopenro("/dev/urandom");
       xreadall(i, libbuf, ((len*6)+7)/8);
       close(i);