(ftpfs_file_store): type accuracy and simplify conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
994c432dd5
Коммит
b968fe0df8
@ -1785,7 +1785,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
|||||||
static int
|
static int
|
||||||
ftpfs_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char *localname)
|
ftpfs_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char *localname)
|
||||||
{
|
{
|
||||||
int h, sock, n_read, n_written;
|
int h, sock;
|
||||||
off_t n_stored;
|
off_t n_stored;
|
||||||
#ifdef HAVE_STRUCT_LINGER_L_LINGER
|
#ifdef HAVE_STRUCT_LINGER_L_LINGER
|
||||||
struct linger li;
|
struct linger li;
|
||||||
@ -1821,20 +1821,20 @@ ftpfs_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, cha
|
|||||||
tty_enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
|
ssize_t n_read, n_written;
|
||||||
|
|
||||||
while ((n_read = read (h, lc_buffer, sizeof (lc_buffer))) == -1)
|
while ((n_read = read (h, lc_buffer, sizeof (lc_buffer))) == -1)
|
||||||
{
|
{
|
||||||
if (errno == EINTR)
|
if (errno != EINTR)
|
||||||
{
|
{
|
||||||
if (tty_got_interrupt ())
|
ftpfs_errno = errno;
|
||||||
{
|
goto error_return;
|
||||||
ftpfs_errno = EINTR;
|
}
|
||||||
goto error_return;
|
if (tty_got_interrupt ())
|
||||||
}
|
{
|
||||||
else
|
ftpfs_errno = EINTR;
|
||||||
continue;
|
goto error_return;
|
||||||
}
|
}
|
||||||
ftpfs_errno = errno;
|
|
||||||
goto error_return;
|
|
||||||
}
|
}
|
||||||
if (n_read == 0)
|
if (n_read == 0)
|
||||||
break;
|
break;
|
||||||
@ -1845,9 +1845,8 @@ ftpfs_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, cha
|
|||||||
if (n_written == -1)
|
if (n_written == -1)
|
||||||
{
|
{
|
||||||
if (errno == EINTR && !tty_got_interrupt ())
|
if (errno == EINTR && !tty_got_interrupt ())
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
ftpfs_errno = errno;
|
ftpfs_errno = errno;
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user