Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch
[silc.git] / lib / silccrypt / silcrng.c
index 9538289bab4944b529fb7eea5daef53aa2854565..668a64ea24e73bb9051f09e362676c85c2cf7672 100644 (file)
@@ -243,14 +243,17 @@ static void silc_rng_get_soft_noise(SilcRng rng)
   silc_rng_xor(rng, getpgid(getpid()) << 8, 2);
   silc_rng_xor(rng, getpgid(getpid()) << 8, 3);
 #endif
+#ifdef HAVE_GETGID
   silc_rng_xor(rng, getgid(), 4);
 #endif
+#endif
 #ifdef HAVE_GETPGRP
   silc_rng_xor(rng, getpgrp(), 5);
 #endif
 #ifdef HAVE_GETSID
   silc_rng_xor(rng, getsid(getpid()) << 16, 6);
 #endif
+#ifndef SILC_SYMBIAN
   silc_rng_xor(rng, times(&ptime), 7);
   silc_rng_xor(rng, ptime.tms_utime, 8);
   silc_rng_xor(rng, (ptime.tms_utime + ptime.tms_stime), pos++);
@@ -262,6 +265,7 @@ static void silc_rng_get_soft_noise(SilcRng rng)
   silc_rng_xor(rng, (ptime.tms_stime ^ ptime.tms_cutime), pos++);
   silc_rng_xor(rng, (ptime.tms_cutime + ptime.tms_stime), pos++);
   silc_rng_xor(rng, (ptime.tms_stime << 8), pos++);
+#endif /* SILC_SYMBIAN */
 #endif
   silc_rng_xor(rng, clock() << 4, pos++);
 #ifndef SILC_WIN32
@@ -274,8 +278,10 @@ static void silc_rng_get_soft_noise(SilcRng rng)
 #ifdef HAVE_SETSID
   silc_rng_xor(rng, getsid(getpid()) << 16, pos++);
 #endif
+#ifndef SILC_SYMBIAN
   silc_rng_xor(rng, times(&ptime), pos++);
   silc_rng_xor(rng, ptime.tms_utime, pos++);
+#endif /* SILC_SYMBIAN */
 #ifdef HAVE_GETPGRP
   silc_rng_xor(rng, getpgrp(), pos++);
 #endif
@@ -303,8 +309,8 @@ static void silc_rng_get_soft_noise(SilcRng rng)
   silc_rng_xor(rng, (r.ru_nsignals << 16), pos++);
   silc_rng_xor(rng, (r.ru_nvcsw + r.ru_nivcsw), pos++);
   silc_rng_xor(rng, (r.ru_nvcsw ^ r.ru_nivcsw), pos++);
-#endif /*  SILC_SYMBIAN */
-#endif
+#endif /* SILC_SYMBIAN */
+#endif /* HAVE_GETRUSAGE */
   
 #ifdef SILC_RNG_DEBUG
   SILC_LOG_HEXDUMP(("pool"), rng->pool, sizeof(rng->pool));