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
uint64_t stm_now_ms();
void stm_time_init(void);
@ -95,7 +94,7 @@ uint64_t get_time_ms() {
*/
#else
return stm_now_ms();
#endif
#endif
}
void sleep_ms(uint32_t ms) {

View File

@ -24,7 +24,7 @@
uint64_t stm_now_ms() {
uint64_t now = stm_now();
return now/1000000;
return now / 1000000;
}
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);
if (ret <= 0) {
if(errno != EAGAIN) {
perror("recv");
if (errno != EAGAIN) {
if (errno != 0) {
perror("recv");
}
istream_tcp->is_broken = TRUE;
}
}

View File

@ -27,7 +27,6 @@
BEGIN_C_DECLS
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);

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);
if (read_bytes <= 0) {
if(errno == EAGAIN) {
if (errno == EAGAIN) {
sleep_ms(10);
continue;
} else {

View File

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