diff options
-rw-r--r-- | usr.sbin/cpucontrol/intel.c | 3 | ||||
-rw-r--r-- | usr.sbin/cpucontrol/via.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/cpucontrol/intel.c b/usr.sbin/cpucontrol/intel.c index 15ac939..96ab704 100644 --- a/usr.sbin/cpucontrol/intel.c +++ b/usr.sbin/cpucontrol/intel.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> #include <fcntl.h> #include <err.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -266,7 +267,9 @@ matched: args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } diff --git a/usr.sbin/cpucontrol/via.c b/usr.sbin/cpucontrol/via.c index 71ae406..d17e31f 100644 --- a/usr.sbin/cpucontrol/via.c +++ b/usr.sbin/cpucontrol/via.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> #include <fcntl.h> #include <err.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -203,7 +204,9 @@ via_update(const char *dev, const char *path) args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } |