chunk: Externalize error reporting in chunk_write()
This avoids passing that arbitrary label just for error messages, and gives greater flexibility in handling errors.
This commit is contained in:
@@ -521,7 +521,16 @@ METHOD(stroke_cred_t, cache_cert, void,
|
||||
|
||||
if (cert->get_encoding(cert, CERT_ASN1_DER, &chunk))
|
||||
{
|
||||
chunk_write(chunk, buf, "crl", 022, TRUE);
|
||||
if (chunk_write(chunk, buf, 022, TRUE))
|
||||
{
|
||||
DBG1(DBG_CFG, " written crl file '%s' (%d bytes)",
|
||||
buf, chunk.len);
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG1(DBG_CFG, " writing crl file '%s' failed: %s",
|
||||
buf, strerror(errno));
|
||||
}
|
||||
free(chunk.ptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user