]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix getentropy_solaris compile.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Jul 2014 09:59:15 +0000 (09:59 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Jul 2014 09:59:15 +0000 (09:59 +0000)
git-svn-id: file:///svn/unbound/trunk@3162 be551aaa-1e26-0410-a405-d3ace91eadb9

compat/getentropy_solaris.c

index 6aeb8713ab2987ecca0a8c4a4f725e4cd0564363..c49ea151ebdfe9bd83995f7ec2a2f96644d6706a 100644 (file)
@@ -16,6 +16,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#include "config.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -228,7 +229,7 @@ static int
 getentropy_fallback(void *buf, size_t len)
 {
        uint8_t results[SHA512_DIGEST_LENGTH];
-       int save_errno = errno, e, m, pgs = getpagesize(), faster = 0, repeat;
+       int save_errno = errno, e, pgs = getpagesize(), faster = 0, repeat;
        static int cnt;
        struct timespec ts;
        struct timeval tv;
@@ -239,7 +240,7 @@ getentropy_fallback(void *buf, size_t len)
        SHA512_CTX ctx;
        static pid_t lastpid;
        pid_t pid;
-       size_t i, ii;
+       size_t i, ii, m;
        char *p;
 
        pid = getpid();
@@ -267,7 +268,7 @@ getentropy_fallback(void *buf, size_t len)
                        HX((pid = getsid(pid)) == -1, pid);
                        HX((pid = getppid()) == -1, pid);
                        HX((pid = getpgid(0)) == -1, pid);
-                       HX((m = getpriority(0, 0)) == -1, m);
+                       HX((e = getpriority(0, 0)) == -1, e);
                        HX((getloadavg(loadavg, 3) == -1), loadavg);
 
                        if (!faster) {