1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-02 02:15:28 +00:00

1008: Save errno if open() fails in file upload.

This commit is contained in:
Kalle Olavi Niemitalo 2008-05-17 10:39:10 +03:00 committed by Kalle Olavi Niemitalo
parent ffcd91a30d
commit 0298d88167
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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;