Changeset 368ee04 in mainline for uspace/app/websrv/websrv.c
- Timestamp:
- 2017-04-05T18:10:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93ad8166
- Parents:
- 39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/websrv/websrv.c
r39f892a9 r368ee04 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.