format code

This commit is contained in:
xianjimli 2019-10-01 08:51:21 +08:00
parent 4a1a8d1cb4
commit 33a342e8fb
6 changed files with 7 additions and 8 deletions

View File

@ -82,7 +82,6 @@ static ret_t date_time_get_now_impl(date_time_t* dt) {
#endif #endif
uint64_t stm_now_ms(); uint64_t stm_now_ms();
void stm_time_init(void); void stm_time_init(void);

View File

@ -24,7 +24,7 @@
uint64_t stm_now_ms() { uint64_t stm_now_ms() {
uint64_t now = stm_now(); uint64_t now = stm_now();
return now/1000000; return now / 1000000;
} }
void stm_time_init(void) { void stm_time_init(void) {

View File

@ -33,8 +33,10 @@ static int32_t tk_istream_tcp_read(tk_istream_t* stream, uint8_t* buff, uint32_t
ret = recv(istream_tcp->sock, buff, max_size, 0); ret = recv(istream_tcp->sock, buff, max_size, 0);
if (ret <= 0) { if (ret <= 0) {
if(errno != EAGAIN) { if (errno != EAGAIN) {
perror("recv"); if (errno != 0) {
perror("recv");
}
istream_tcp->is_broken = TRUE; istream_tcp->is_broken = TRUE;
} }
} }

View File

@ -27,7 +27,6 @@
BEGIN_C_DECLS BEGIN_C_DECLS
typedef ret_t (*event_source_manager_dispatch_t)(event_source_manager_t* manager); typedef ret_t (*event_source_manager_dispatch_t)(event_source_manager_t* manager);
typedef ret_t (*event_source_manager_destroy_t)(event_source_manager_t* manager); typedef ret_t (*event_source_manager_destroy_t)(event_source_manager_t* manager);

View File

@ -72,7 +72,7 @@ int32_t tk_istream_read_len(tk_istream_t* stream, uint8_t* buff, uint32_t max_si
read_bytes = tk_istream_read(stream, buff + offset, remain_bytes); read_bytes = tk_istream_read(stream, buff + offset, remain_bytes);
if (read_bytes <= 0) { if (read_bytes <= 0) {
if(errno == EAGAIN) { if (errno == EAGAIN) {
sleep_ms(10); sleep_ms(10);
continue; continue;
} else { } else {

View File

@ -361,5 +361,4 @@ typedef struct _event_source_t event_source_t;
struct _event_source_manager_t; struct _event_source_manager_t;
typedef struct _event_source_manager_t event_source_manager_t; typedef struct _event_source_manager_t event_source_manager_t;
#endif /*TYPES_DEF_H*/ #endif /*TYPES_DEF_H*/