diff options
Diffstat (limited to 'customdhcpcd/src/logwriter.c')
-rw-r--r-- | customdhcpcd/src/logwriter.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/customdhcpcd/src/logwriter.c b/customdhcpcd/src/logwriter.c index 6a04821..a96bbda 100644 --- a/customdhcpcd/src/logwriter.c +++ b/customdhcpcd/src/logwriter.c @@ -62,23 +62,6 @@ void closeQtLoggerSocket (){ close(sockfd); } -/* -void logToQt(char * status, char * substatus, char * msg) { - char * m = malloc(strlen(interfaceName) + strlen(status) + strlen(substatus) + strlen(msg) +4 ); - strcpy(m,interfaceName); - strcat(m,";"); - strcat(m,status); - strcat(m,";"); - strcat(m,substatus); - strcat(m,";"); - strcat(m,msg); - sendToQt(m); - - free(m); -} -*/ - - void sendToQt(log_msg * msg) { int n = -1; int t; @@ -107,14 +90,12 @@ void sendToQt(log_msg * msg) { if (outbuf != NULL) { n = send(sockfd, outbuf, DHCP_MESSAGE_SIZE, 0); } - //free(outbuf); syslog(LOG_INFO, "[fbgui] INFO writing to socket: [%d:%d] %s (%s)", msg->status, msg->substatus, msg->msg, msg->device); - // fflush(sockfd); + if (n <= 0) { syslog(LOG_ERR, "[fbgui] ERROR writing to socket: [%d:%d] %s (%s)", msg->status, msg->substatus, msg->msg, msg->device); - // fprintf(stdout, "ERROR writing to socket: %s", msg); } memset(ack,0,ACK_SIZE); if ((t = recv(sockfd, ack, ACK_SIZE, 0)) > 0) { @@ -126,7 +107,6 @@ void sendToQt(log_msg * msg) { else syslog(LOG_ERR, "[fbgui] ERROR Server closed"); } - //usleep(500); } void logToQt(int status, int substatus, const char * msg) { |