mirror of
https://github.com/rkd77/elinks.git
synced 2024-07-07 13:34:34 -04: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);
|
conn->post_fd = open(file + 1, O_RDONLY);
|
||||||
*end = FILE_CHAR;
|
*end = FILE_CHAR;
|
||||||
if (conn->post_fd < 0) {
|
if (conn->post_fd < 0) {
|
||||||
|
int errno_from_open = errno;
|
||||||
|
|
||||||
done_string(&data);
|
done_string(&data);
|
||||||
/* FIXME: proper error code */
|
abort_connection(conn, -errno_from_open);
|
||||||
abort_connection(conn, S_OUT_OF_MEM);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
http->post_data = end + 1;
|
http->post_data = end + 1;
|
||||||
|
@ -669,9 +669,10 @@ send_files(struct socket *socket)
|
|||||||
conn->post_fd = open(file + 1, O_RDONLY);
|
conn->post_fd = open(file + 1, O_RDONLY);
|
||||||
*end = FILE_CHAR;
|
*end = FILE_CHAR;
|
||||||
if (conn->post_fd < 0) {
|
if (conn->post_fd < 0) {
|
||||||
|
int errno_from_open = errno;
|
||||||
|
|
||||||
done_string(&data);
|
done_string(&data);
|
||||||
/* FIXME: proper error code */
|
http_end_request(conn, -errno_from_open, 0);
|
||||||
http_end_request(conn, S_OUT_OF_MEM, 0);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
http->post_data = end + 1;
|
http->post_data = end + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user