Code cleanup
This commit is contained in:
parent
b8d01c64d5
commit
33947cba4a
@ -1961,10 +1961,13 @@ static gboolean _on_reset(gpointer data)
|
|||||||
event->status.status = MODEM_STATUS_UNKNOWN;
|
event->status.status = MODEM_STATUS_UNKNOWN;
|
||||||
/* logging */
|
/* logging */
|
||||||
logfile = helper->config_get(helper->modem, "logfile");
|
logfile = helper->config_get(helper->modem, "logfile");
|
||||||
if(logfile != NULL && (channel->fp = fopen(logfile, "w")) == NULL)
|
if(logfile != NULL)
|
||||||
hayes->helper->error(NULL, strerror(errno), 1);
|
{
|
||||||
else if(channel->fp != NULL)
|
if((channel->fp = fopen(logfile, "w")) == NULL)
|
||||||
setvbuf(channel->fp, NULL, _IONBF, BUFSIZ);
|
hayes->helper->error(NULL, strerror(errno), 1);
|
||||||
|
else
|
||||||
|
setvbuf(channel->fp, NULL, _IONBF, BUFSIZ);
|
||||||
|
}
|
||||||
channel->channel = g_io_channel_unix_new(fd);
|
channel->channel = g_io_channel_unix_new(fd);
|
||||||
if(g_io_channel_set_encoding(channel->channel, NULL, &error)
|
if(g_io_channel_set_encoding(channel->channel, NULL, &error)
|
||||||
!= G_IO_STATUS_NORMAL)
|
!= G_IO_STATUS_NORMAL)
|
||||||
|
Loading…
Reference in New Issue
Block a user