mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Avoid clobbering errno with a call to fprintf
PR: bin/173923 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: cperciva MFC After: 3 days
This commit is contained in:
parent
3c1adb82f9
commit
bab89cefc7
2 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue