summaryrefslogtreecommitdiff
path: root/cups/file.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-05-15 01:42:36 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-05-15 01:42:36 +0000
commitc9fc04c6ec14cb5073b49491ab90551183743b4d (patch)
tree2b1b03cd31fd7dd3f26e9dcadb40cc7c2f0a16cf /cups/file.c
parent969307f09661cc4884f54b3e5742b9768516d2a0 (diff)
downloadcups-c9fc04c6ec14cb5073b49491ab90551183743b4d.tar.gz
Merge changes from CUPS trunk, r7566.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@761 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/file.c')
-rw-r--r--cups/file.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/cups/file.c b/cups/file.c
index 28453952a..d3726cf53 100644
--- a/cups/file.c
+++ b/cups/file.c
@@ -1413,7 +1413,11 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
}
#endif /* HAVE_LIBZ */
- lseek(fp->fd, 0, SEEK_SET);
+ if (lseek(fp->fd, 0, SEEK_SET))
+ {
+ DEBUG_printf(("cupsFileRewind: lseek failed: %s\n", strerror(errno)));
+ return (-1);
+ }
fp->bufpos = 0;
fp->pos = 0;
@@ -1692,7 +1696,7 @@ off_t /* O - File position */
cupsFileTell(cups_file_t *fp) /* I - CUPS file */
{
DEBUG_printf(("cupsFileTell(fp=%p)\n", fp));
- DEBUG_printf(("cupsFileTell: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("cupsFileTell: pos=" CUPS_LLFMT "\n", CUPS_LLCAST (fp ? fp->pos : -1)));
return (fp ? fp->pos : 0);
}
@@ -1867,7 +1871,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
fp->ptr, fp->end, fp->buf, CUPS_LLCAST fp->bufpos, fp->eof));
if (fp->ptr && fp->end)
- fp->bufpos += fp->end - fp->ptr;
+ fp->bufpos += fp->end - fp->buf;
#ifdef HAVE_LIBZ
DEBUG_printf(("cups_fill: fp->compressed=%d\n", fp->compressed));
@@ -1915,7 +1919,8 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
fp->ptr = fp->buf;
fp->end = fp->buf + bytes;
- DEBUG_printf((" returning " CUPS_LLFMT "!\n", CUPS_LLCAST bytes));
+ DEBUG_printf(("cups_fill: Returning " CUPS_LLFMT "!\n",
+ CUPS_LLCAST bytes));
return (bytes);
}