]> mj.ucw.cz Git - pciutils.git/blobdiff - setpci.c
On newer Linux systems, use libkmod to look up kernel modules
[pciutils.git] / setpci.c
index 97740e8c2168c0c3f534b57571a7501a8f15c49c..731c612504e15e9404942407112581e1139606fe 100644 (file)
--- a/setpci.c
+++ b/setpci.c
@@ -10,7 +10,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#include <unistd.h>
 #include <errno.h>
 
 #define PCIUTILS_SETPCI
@@ -482,11 +481,12 @@ static const struct reg_name *parse_reg_name(char *name)
 static int parse_x32(char *c, char **stopp, unsigned int *resp)
 {
   char *stop;
+  unsigned long int l;
 
   if (!*c)
     return -1;
   errno = 0;
-  unsigned long int l = strtoul(c, &stop, 16);
+  l = strtoul(c, &stop, 16);
   if (errno)
     return -1;
   if ((l & ~0U) != l)