summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-18 18:02:15 +0000
committerJeremy Allison <jra@samba.org>2005-05-18 18:02:15 +0000
commitc98f5e01f52a51b627b39d911172d60d802dfbbb (patch)
tree09b7853963ea75aefadc45321b60f61430e6f6f5 /source/printing
parent692a24d28dda6be9fcc1d53bf6a688cd7f63bc90 (diff)
downloadsamba-c98f5e01f52a51b627b39d911172d60d802dfbbb.tar.gz
samba-c98f5e01f52a51b627b39d911172d60d802dfbbb.tar.xz
samba-c98f5e01f52a51b627b39d911172d60d802dfbbb.zip
r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found by Arcady Chernyak <Arcady.Chernyak@efi.com> Jeremy.
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/printing.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c
index 03bdb7d4212..ab86db53f38 100644
--- a/source/printing/printing.c
+++ b/source/printing/printing.c
@@ -2031,7 +2031,7 @@ pause, or resume print job. User name: %s. Printer name: %s.",
Write to a print file.
****************************************************************************/
-int print_job_write(int snum, uint32 jobid, const char *buf, int size)
+ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size)
{
const char* sharename = lp_const_servicename(snum);
int return_code;
@@ -2045,7 +2045,8 @@ int print_job_write(int snum, uint32 jobid, const char *buf, int size)
if (pjob->pid != sys_getpid())
return -1;
- return_code = write(pjob->fd, buf, size);
+ return_code = write_data_at_offset(pjob->fd, buf, size, pos);
+
if (return_code>0) {
pjob->size += size;
pjob_store(sharename, jobid, pjob);