OCT 1. 统一日志调用函数

This commit is contained in:
huangxin 2022-11-23 10:46:36 +08:00
parent 28d0eb893e
commit a57cf4c5d2
1 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ static void sendUserList(data19 *req, const char *pRequest) {
char logBuff[512];
dhcpMap::iterator p;
printf("Input: %s\n", pRequest);
dzlog_debug("Input: %s\n", pRequest);
if (pRequest == nullptr || strlen(pRequest) == 0) {
sprintf(logBuff, "Requeset Json");
@ -293,7 +293,7 @@ int getHwAddr(char *buff, char *mac) {
int arpSet(const char *ifname, char *ipStr, char *mac) {
if (ifname == nullptr || ipStr == nullptr || mac == nullptr) {
printf("para is null.\n");
dzlog_error("para is null.\n");
return -1;
}
@ -311,19 +311,19 @@ int arpSet(const char *ifname, char *ipStr, char *mac) {
req.arp_flags = ATF_PERM | ATF_COM;
if (getHwAddr((char *)req.arp_ha.sa_data, mac) < 0) {
printf("get mac error.\n");
dzlog_error("get mac error.\n");
return -1;
}
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
if (sock_fd < 0) {
printf("get socket error.\n");
dzlog_error("get socket error.\n");
return -1;
}
ret = ioctl(sock_fd, SIOCSARP, &req);
if (ret < 0) {
printf("ioctl error.\n");
dzlog_error("ioctl error.\n");
close(sock_fd);
return -1;
}