Changeset 359 for asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c
- Timestamp:
- Jun 20, 2018, 7:59:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c
r352 r359 50 50 #include <t_syslog.h> 51 51 #include "kernel_cfg.h" 52 #include "util/ntstdio.h" 53 54 extern ntstdio_t ntstdio; 52 55 53 56 #endif /* of #if defined(TARGET_KERNEL_ASP) */ … … 276 279 } 277 280 278 syslog(LOG_NOTICE, "[NTP CLI,%d] recv time: %s .%09u",281 ntstdio_printf(&ntstdio, "[NTP CLI,%d] recv time: %s .%09u\n", 279 282 nc->cepid, nc->buf, tp.tv_nsec); 280 283 } … … 308 311 line = lookup_ipaddr(&nc->ipaddr6, NTP_SRV_URL, API_PROTO_IPV4); 309 312 if (line == NULL || !in6_is_addr_ipv4mapped(&nc->ipaddr6)) { 310 syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",313 ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.", 311 314 nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ); 312 315 nc->timer = SLP_ITV; … … 316 319 #else /* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */ 317 320 if ((line = lookup_ipaddr(&nc->snd_rmt.ipaddr, NTP_SRV_URL, DEFAULT_API_PROTO)) == NULL) { 318 syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",321 ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.", 319 322 nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ); 320 323 nc->timer = SLP_ITV; … … 420 423 421 424 if ((error = udp_snd_dat(nc->cepid, &nc->snd_rmt, ntp, len, TMO_NBLK)) != E_WBLK) { 422 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_snd_dat error: %s",425 ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_snd_dat error: %s", 423 426 nc->cepid, itron_strerror(error)); 424 427 return error; … … 438 441 ret = get_tim(&time); 439 442 if (ret != E_OK) { 440 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",443 ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s", 441 444 nc->cepid, itron_strerror(ret)); 442 445 tp->tv_sec = 0; … … 458 461 ret = set_tim(time); 459 462 if (ret != E_OK) { 460 syslog(LOG_NOTICE, "[NTP CLI,%d] set_tim error: %s",463 ntstdio_printf(&ntstdio, "[NTP CLI,%d] set_tim error: %s", 461 464 nc->cepid, itron_strerror(ret)); 462 465 } … … 476 479 if (len < 0 && len != E_RLWAI) { 477 480 /* E_RLWAI 以外で、0 以下の場合は、エラーを意味している。*/ 478 syslog(LOG_NOTICE, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,481 ntstdio_printf(&ntstdio, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid, 479 482 itron_strerror(len), in_strtfn(fncd)); 480 483 } … … 483 486 if ((len = udp_rcv_dat(nc->cepid, &nc->rcv_rmt, &nc->ntp_msg, len, TMO_POL)) < 0) 484 487 { 485 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,488 ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid, 486 489 itron_strerror(len)); 487 490 } … … 515 518 516 519 get_tid(&nc->tskid); 517 syslog(LOG_NOTICE, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);520 ntstdio_printf(&ntstdio, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf); 518 521 519 522 /* 初期化 */ … … 522 525 ret = get_tim(&time); 523 526 if (ret != E_OK) { 524 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %7lu,%s",527 ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %7lu,%s", 525 528 nc->cepid, time / SYSTIM_HZ, itron_strerror(ret)); 526 529 return; … … 536 539 error = tslp_tsk(timer); 537 540 if ((error != E_OK) && (error != E_TMOUT)) { 538 syslog(LOG_NOTICE, "[NTP CLI,%d] tslp_tsk error: %s %d",541 ntstdio_printf(&ntstdio, "[NTP CLI,%d] tslp_tsk error: %s %d", 539 542 nc->cepid, itron_strerror(error), timer); 540 543 break; … … 543 546 ret = get_tim(&time); 544 547 if (ret != E_OK) { 545 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",548 ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s", 546 549 nc->cepid, itron_strerror(ret)); 547 550 break;
Note:
See TracChangeset
for help on using the changeset viewer.