Changes in uspace/lib/c/generic/uuid.c [582a0b8:c718bda] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/uuid.c
r582a0b8 rc718bda 43 43 * 44 44 * @param uuid Place to store generated UUID 45 * @return EOK on success or negativeerror code45 * @return EOK on success or an error code 46 46 */ 47 int uuid_generate(uuid_t *uuid)47 errno_t 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 om(tv.tv_sec ^ tv.tv_usec);54 srand(tv.tv_sec ^ tv.tv_usec); 55 55 56 56 for (i = 0; i < uuid_bytes; i++) 57 uuid->b[i] = rand om();57 uuid->b[i] = rand(); 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 negativeerror code102 * @return EOK on success or an error code 103 103 */ 104 int uuid_parse(const char *str, uuid_t *uuid, const char **endptr)104 errno_t uuid_parse(const char *str, uuid_t *uuid, const char **endptr) 105 105 { 106 int rc;106 errno_t 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 int uuid_format(uuid_t *uuid, char **rstr)169 errno_t uuid_format(uuid_t *uuid, char **rstr) 170 170 { 171 171 return ENOTSUP;
Note:
See TracChangeset
for help on using the changeset viewer.