mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
proper checking for lseek() failure
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2601 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
fc20431dbb
commit
c726496953
@ -125,6 +125,7 @@ static void ctcp_msg_dcc_accept(IRC_SERVER_REC *server, const char *data,
|
|||||||
/* Resume a DCC GET */
|
/* Resume a DCC GET */
|
||||||
static void dcc_send_resume(GET_DCC_REC *dcc)
|
static void dcc_send_resume(GET_DCC_REC *dcc)
|
||||||
{
|
{
|
||||||
|
off_t pos;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
g_return_if_fail(dcc != NULL);
|
g_return_if_fail(dcc != NULL);
|
||||||
@ -139,8 +140,8 @@ static void dcc_send_resume(GET_DCC_REC *dcc)
|
|||||||
|
|
||||||
dcc->get_type = DCC_GET_RESUME;
|
dcc->get_type = DCC_GET_RESUME;
|
||||||
|
|
||||||
dcc->transfd = lseek(dcc->fhandle, 0, SEEK_END);
|
pos = lseek(dcc->fhandle, 0, SEEK_END);
|
||||||
if (dcc->transfd < 0) dcc->transfd = 0;
|
dcc->transfd = pos == (off_t)-1 ? 0 : (unsigned long) pos;
|
||||||
dcc->skipped = dcc->transfd;
|
dcc->skipped = dcc->transfd;
|
||||||
|
|
||||||
if (dcc->skipped == dcc->size) {
|
if (dcc->skipped == dcc->size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user