1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04: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:
Timo Sirainen 2002-03-13 03:19:04 +00:00 committed by cras
parent fc20431dbb
commit c726496953

View File

@ -125,6 +125,7 @@ static void ctcp_msg_dcc_accept(IRC_SERVER_REC *server, const char *data,
/* Resume a DCC GET */
static void dcc_send_resume(GET_DCC_REC *dcc)
{
off_t pos;
char *str;
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->transfd = lseek(dcc->fhandle, 0, SEEK_END);
if (dcc->transfd < 0) dcc->transfd = 0;
pos = lseek(dcc->fhandle, 0, SEEK_END);
dcc->transfd = pos == (off_t)-1 ? 0 : (unsigned long) pos;
dcc->skipped = dcc->transfd;
if (dcc->skipped == dcc->size) {