Ignore:
Timestamp:
May 22, 2019, 4:09:18 PM (5 years ago)
Author:
coas-nagasima
Message:

ファイルディスクリプタ処理を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c

    r374 r387  
    277277        }
    278278
    279         printf("[NTP CLI,%d] recv time: %s .%09u\n",
     279        syslog(LOG_NOTICE, "[NTP CLI,%d] recv time: %s .%09u",
    280280                nc->cepid, nc->buf, tp.tv_nsec);
    281281}
     
    309309                line = lookup_ipaddr(&nc->ipaddr6, NTP_SRV_URL, API_PROTO_IPV4);
    310310                if (line == NULL || !in6_is_addr_ipv4mapped(&nc->ipaddr6)) {
    311                         printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     311                        syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    312312                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    313313                        nc->timer = SLP_ITV;
     
    317317#else   /* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
    318318                if ((line = lookup_ipaddr(&nc->snd_rmt.ipaddr, NTP_SRV_URL, DEFAULT_API_PROTO)) == NULL) {
    319                         printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     319                        syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    320320                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    321321                        nc->timer = SLP_ITV;
     
    421421
    422422        if ((error = udp_snd_dat(nc->cepid, &nc->snd_rmt, ntp, len, TMO_NBLK)) != E_WBLK) {
    423                 printf("[NTP CLI,%d] udp_snd_dat error: %s",
     423                syslog(LOG_NOTICE, "[NTP CLI,%d] udp_snd_dat error: %s",
    424424                        nc->cepid, itron_strerror(error));
    425425                return error;
    426426        }
    427427        else
    428                 syslog(LOG_DEBUG, "[NTP CLI,%d] udp_snd_dat: to: %s.%d\n",
     428                syslog(LOG_DEBUG, "[NTP CLI,%d] udp_snd_dat: to: %s.%d",
    429429                        nc->cepid, ip2str(NULL, &nc->snd_rmt.ipaddr), nc->snd_rmt.portno);
    430430
     
    439439        ret = get_tim(&time);
    440440        if (ret != E_OK) {
    441                 printf("[NTP CLI,%d] get_tim error: %s",
     441                syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",
    442442                        nc->cepid, itron_strerror(ret));
    443443                tp->tv_sec = 0;
     
    459459        ret = set_tim(time);
    460460        if (ret != E_OK) {
    461                 printf("[NTP CLI,%d] set_tim error: %s",
     461                syslog(LOG_NOTICE, "[NTP CLI,%d] set_tim error: %s",
    462462                        nc->cepid, itron_strerror(ret));
    463463        }
     
    477477        if (len < 0 && len != E_RLWAI) {
    478478                /* E_RLWAI 以外で、0 以下の場合は、エラーを意味している。*/
    479                 printf("[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
     479                syslog(LOG_NOTICE, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
    480480                        itron_strerror(len), in_strtfn(fncd));
    481481        }
     
    484484                        if ((len = udp_rcv_dat(nc->cepid, &nc->rcv_rmt, &nc->ntp_msg, len, TMO_POL)) < 0)
    485485                        {
    486                                 printf("[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
     486                                syslog(LOG_NOTICE, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
    487487                                        itron_strerror(len));
    488488                        }
     
    516516
    517517        get_tid(&nc->tskid);
    518         printf("[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
     518        syslog(LOG_NOTICE, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
    519519
    520520        /* 初期化 */
     
    523523        ret = get_tim(&time);
    524524        if (ret != E_OK) {
    525                 printf("[NTP CLI,%d] get_tim error: %7lu,%s",
     525                syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %7lu,%s",
    526526                        nc->cepid, time / SYSTIM_HZ, itron_strerror(ret));
    527527                return;
     
    537537                error = tslp_tsk(timer);
    538538                if ((error != E_OK) && (error != E_TMOUT)) {
    539                         printf("[NTP CLI,%d] tslp_tsk error: %s %d",
     539                        syslog(LOG_NOTICE, "[NTP CLI,%d] tslp_tsk error: %s %d",
    540540                                nc->cepid, itron_strerror(error), timer);
    541541                        break;
     
    544544                ret = get_tim(&time);
    545545                if (ret != E_OK) {
    546                         printf("[NTP CLI,%d] get_tim error: %s",
     546                        syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",
    547547                                nc->cepid, itron_strerror(ret));
    548548                        break;
Note: See TracChangeset for help on using the changeset viewer.