X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Frand.c;h=6edc3f2e33579b74e3037dc13c2cf3ae760b7390;hb=aa3de31b70d1c5826d67147696423cdd9c334d41;hp=4ed1203f85df3390b9d75bd5c597ec955c0c6dea;hpb=4f021d81ca18b1aca6fd46165becb49bb9c63c25;p=mono.git diff --git a/mono/metadata/rand.c b/mono/metadata/rand.c index 4ed1203f85d..6edc3f2e335 100644 --- a/mono/metadata/rand.c +++ b/mono/metadata/rand.c @@ -26,7 +26,7 @@ #include #include -#if !defined(__native_client__) && !defined(HOST_WIN32) +#if !defined(__native_client__) && !defined(HOST_WIN32) && defined (HAVE_SYS_UN_H) #include #include #include @@ -44,8 +44,8 @@ get_entropy_from_server (const char *path, guchar *buf, int len) ret = -1; else { egd_addr.sun_family = AF_UNIX; - strncpy (egd_addr.sun_path, path, MONO_SIZEOF_SUNPATH - 1); - egd_addr.sun_path [MONO_SIZEOF_SUNPATH-1] = '\0'; + strncpy (egd_addr.sun_path, path, sizeof(egd_addr.sun_path) - 1); + egd_addr.sun_path [sizeof(egd_addr.sun_path)-1] = '\0'; ret = connect (file, (struct sockaddr *)&egd_addr, sizeof(egd_addr)); } if (ret == -1) { @@ -180,7 +180,7 @@ ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpoint CryptReleaseContext ((HCRYPTPROV) handle, 0); } -#elif defined (__native_client__) +#elif defined (__native_client__) || !defined (HAVE_SYS_UN_H) #include