summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-03-13 03:19:04 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-03-13 03:19:04 +0000
commitc72649695371a92ae89162d2540d08274b1bc60d (patch)
treea26d50932219769b420a37d7021b65590eca3d3e /src/irc
parentfc20431dbb31865b7825ebf84e248e6ddc4861ac (diff)
downloadirssi-c72649695371a92ae89162d2540d08274b1bc60d.zip
proper checking for lseek() failure
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2601 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/dcc/dcc-resume.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/irc/dcc/dcc-resume.c b/src/irc/dcc/dcc-resume.c
index 899a7475..b273c54d 100644
--- a/src/irc/dcc/dcc-resume.c
+++ b/src/irc/dcc/dcc-resume.c
@@ -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) {