diff options
Diffstat (limited to 'server.c')
| -rw-r--r-- | server.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -11,14 +11,18 @@ #include <sys/sendfile.h> #include <unistd.h> -int shsd_sendfile(int in_fd, FILE *ou_fd, struct stat *s) +int shsd_sendfile(int in_fd, FILE *ou_fd) { - int stat_result = fstat(fileno(ou_fd), s); + struct stat s; + int stat_result = fstat(fileno(ou_fd), &s); if (stat_result != 0) { perror("fstat"); return -1; } - sendfile(in_fd, fileno(ou_fd), NULL, s->st_size); + sendfile(in_fd, fileno(ou_fd), NULL, s.st_size); + + return 0; +} return 0; } |
