summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-18 18:02:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:56 -0500
commitfe0ce8dd8e18de6110404661f26db7a66ebac5ad (patch)
treefdc3855c259384f7773d3e6d9054b282d81a8553 /source3/printing
parent3b0df6770db55a7690473547bef29a5a7bede0b9 (diff)
downloadsamba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.tar.gz
samba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.tar.bz2
samba-fe0ce8dd8e18de6110404661f26db7a66ebac5ad.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. (This used to be commit 482f7e0e3706098b71aa0b31a134994acb1e9fcf)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 03bdb7d421..ab86db53f3 100644
--- a/source3/printing/printing.c
+++ b/source3/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);