file = fopen(RESOLV_CONF, "r");
if (file == NULL || stat(RESOLV_CONF, &stats) != 0)
{
file = fopen(RESOLV_CONF, "r");
if (file == NULL || stat(RESOLV_CONF, &stats) != 0)
{
- DBG1(DBG_IKE, "unable to open DNS configuration file %s: %m", RESOLV_CONF);
+ DBG1(DBG_IKE, "unable to open DNS configuration file %s: %s",
+ RESOLV_CONF, strerror(errno));
if (fread(contents.ptr, 1, contents.len, file) != contents.len)
{
if (fread(contents.ptr, 1, contents.len, file) != contents.len)
{
- DBG1(DBG_IKE, "unable to open DNS configuration file %s: %m", RESOLV_CONF);
+ DBG1(DBG_IKE, "unable to open DNS configuration file %s: %s",
+ RESOLV_CONF, strerror(errno));
file = fopen(RESOLV_CONF, "a+");
if (file == NULL || stat(RESOLV_CONF, &stats) != 0)
{
file = fopen(RESOLV_CONF, "a+");
if (file == NULL || stat(RESOLV_CONF, &stats) != 0)
{
- DBG1(DBG_IKE, "unable to open DNS configuration file %s: %m", RESOLV_CONF);
+ DBG1(DBG_IKE, "unable to open DNS configuration file %s: %s",
+ RESOLV_CONF, strerror(errno));
if (fread(contents.ptr, 1, contents.len, file) != contents.len)
{
if (fread(contents.ptr, 1, contents.len, file) != contents.len)
{
- DBG1(DBG_IKE, "unable to open DNS configuration file %s: %m", RESOLV_CONF);
+ DBG1(DBG_IKE, "unable to open DNS configuration file %s: %s",
+ RESOLV_CONF, strerror(errno));
return;
}
if (fprintf(file, "nameserver %H # added by strongSwan, assigned by %D\n",
dns, this->other_id) < 0)
{
return;
}
if (fprintf(file, "nameserver %H # added by strongSwan, assigned by %D\n",
dns, this->other_id) < 0)
{