1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00: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:
Eitan Adler 2013-01-16 05:00:51 +00:00
parent 3c1adb82f9
commit bab89cefc7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245491
2 changed files with 6 additions and 0 deletions

View File

@ -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 @@ intel_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;
}

View File

@ -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;
}