replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / c_common / ocrandom / src / ocrandom.c
index e53c594..e0dcdc5 100644 (file)
@@ -141,7 +141,7 @@ int8_t OCSeedRandom()
     gettimeofday(&tv, NULL);
     currentTime = tv.tv_sec * (uint64_t)1000000 + tv.tv_usec;
 #endif
-#if defined(__unix__) || defined(__APPLE__)
+#if defined(__unix__) || defined(__APPLE__) || defined(__TIZENRT__)
     int32_t fd = open("/dev/urandom", O_RDONLY);
     if (fd >= 0)
     {
@@ -333,7 +333,6 @@ OCRandomUuidResult OCGenerateUuidString(char uuidString[UUID_STRING_SIZE])
     }
     else
     {
-        close(fd);
         return RAND_UUID_READ_ERROR;
     }
 #elif defined(HAVE_UUID_UUID_H)