Changes in uspace/lib/c/generic/uuid.c [c718bda:582a0b8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/uuid.c
rc718bda r582a0b8 43 43 * 44 44 * @param uuid Place to store generated UUID 45 * @return EOK on success or anerror code45 * @return EOK on success or negative error code 46 46 */ 47 errno_t uuid_generate(uuid_t *uuid)47 int uuid_generate(uuid_t *uuid) 48 48 { 49 49 int i; … … 52 52 /* XXX This is a rather poor way of generating random numbers */ 53 53 gettimeofday(&tv, NULL); 54 srand (tv.tv_sec ^ tv.tv_usec);54 srandom(tv.tv_sec ^ tv.tv_usec); 55 55 56 56 for (i = 0; i < uuid_bytes; i++) 57 uuid->b[i] = rand ();57 uuid->b[i] = random(); 58 58 59 59 /* Version 4 UUID from random or pseudo-random numbers */ … … 100 100 * @param endptr Place to store pointer to end of UUID or @c NULL 101 101 * 102 * @return EOK on success or anerror code102 * @return EOK on success or negative error code 103 103 */ 104 errno_t uuid_parse(const char *str, uuid_t *uuid, const char **endptr)104 int uuid_parse(const char *str, uuid_t *uuid, const char **endptr) 105 105 { 106 errno_t rc;106 int rc; 107 107 const char *eptr; 108 108 uint32_t time_low; … … 167 167 * @return EOK on success, ENOMEM if out of memory 168 168 */ 169 errno_t uuid_format(uuid_t *uuid, char **rstr)169 int uuid_format(uuid_t *uuid, char **rstr) 170 170 { 171 171 return ENOTSUP;
Note:
See TracChangeset
for help on using the changeset viewer.