mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
If 'req' is NULL, print error on stderr.
MFC after: 3 days
This commit is contained in:
parent
c99a654256
commit
275ae453d6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226718
@ -379,10 +379,15 @@ gctl_error(struct gctl_req *req, const char *error, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (req->error != NULL)
|
||||
if (req != NULL && req->error != NULL)
|
||||
return;
|
||||
va_start(ap, error);
|
||||
vasprintf(&req->error, error, ap);
|
||||
if (req != NULL) {
|
||||
vasprintf(&req->error, error, ap);
|
||||
} else {
|
||||
vfprintf(stderr, error, ap);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user