mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
1008: Save errno if open() fails in file upload.
This commit is contained in:
parent
ffcd91a30d
commit
0298d88167
@ -138,9 +138,10 @@ send_files(struct socket *socket)
|
||||
conn->post_fd = open(file + 1, O_RDONLY);
|
||||
*end = FILE_CHAR;
|
||||
if (conn->post_fd < 0) {
|
||||
int errno_from_open = errno;
|
||||
|
||||
done_string(&data);
|
||||
/* FIXME: proper error code */
|
||||
abort_connection(conn, S_OUT_OF_MEM);
|
||||
abort_connection(conn, -errno_from_open);
|
||||
return;
|
||||
}
|
||||
http->post_data = end + 1;
|
||||
|
@ -669,9 +669,10 @@ send_files(struct socket *socket)
|
||||
conn->post_fd = open(file + 1, O_RDONLY);
|
||||
*end = FILE_CHAR;
|
||||
if (conn->post_fd < 0) {
|
||||
int errno_from_open = errno;
|
||||
|
||||
done_string(&data);
|
||||
/* FIXME: proper error code */
|
||||
http_end_request(conn, S_OUT_OF_MEM, 0);
|
||||
http_end_request(conn, -errno_from_open, 0);
|
||||
return;
|
||||
}
|
||||
http->post_data = end + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user