Changes in uspace/app/websrv/websrv.c [b99f6e2:ce04ea44] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/websrv/websrv.c
rb99f6e2 rce04ea44 39 39 #include <stdio.h> 40 40 #include <sys/types.h> 41 #include <sys/stat.h>42 41 #include <stdlib.h> 43 #include <fcntl.h>44 42 #include <task.h> 43 44 #include <vfs/vfs.h> 45 45 46 46 #include <inet/addr.h> … … 225 225 return ENOMEM; 226 226 227 int fd = open(fname, O_RDONLY);227 int fd = vfs_lookup_open(fname, WALK_REGULAR, MODE_READ); 228 228 if (fd < 0) { 229 229 rc = send_response(conn, msg_not_found); … … 238 238 return rc; 239 239 240 aoff64_t pos = 0; 240 241 while (true) { 241 ssize_t nr = read(fd, fbuf, BUFFER_SIZE);242 ssize_t nr = vfs_read(fd, &pos, fbuf, BUFFER_SIZE); 242 243 if (nr == 0) 243 244 break; 244 245 245 246 if (nr < 0) { 246 close(fd);247 vfs_put(fd); 247 248 return EIO; 248 249 } … … 251 252 if (rc != EOK) { 252 253 fprintf(stderr, "tcp_conn_send() failed\n"); 253 close(fd);254 vfs_put(fd); 254 255 return rc; 255 256 } 256 257 } 257 258 258 close(fd);259 vfs_put(fd); 259 260 260 261 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.