1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-09 18:51:54 +08:00

修正linux sendfile返回值判断

This commit is contained in:
fumiama
2021-05-05 22:50:55 +08:00
parent 4f0eb77b23
commit 8bdd13978c

View File

@@ -133,7 +133,7 @@ int send_all(char* file_path, THREADTIMER *timer) {
if(!re) perror("Sendfile");
#else
send(timer->accept_fd, &file_size, sizeof(uint32_t), 0);
re = !sendfile(timer->accept_fd, fileno(fp), &len, file_size);
re = sendfile(timer->accept_fd, fileno(fp), &len, file_size) >= 0;
if(!re) perror("Sendfile");
#endif
printf("Send %lld bytes.\n", len);