mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
format code
This commit is contained in:
parent
4a1a8d1cb4
commit
33a342e8fb
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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*/
|
||||
|
Loading…
Reference in New Issue
Block a user