summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-02-08 01:04:43 +0000
committerJeremy Allison <jra@samba.org>2003-02-08 01:04:43 +0000
commit4703248a8e7287b738fa82edfd91fb2b13e7c222 (patch)
treedd70c2d8fedc1c351b5ad6f2d5b06abe087ca9b1 /source3/printing
parent8f166a97259444a284f9839689db563ff58cf73b (diff)
downloadsamba-4703248a8e7287b738fa82edfd91fb2b13e7c222.tar.gz
samba-4703248a8e7287b738fa82edfd91fb2b13e7c222.tar.bz2
samba-4703248a8e7287b738fa82edfd91fb2b13e7c222.zip
Ensure we return NOSPACE if we can't fast allocate a print job.
Jeremy. (This used to be commit 82cf8aa74794649fb16c336011ca48d549d6abb8)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index a46fff0de2..3bf992ad69 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1595,6 +1595,8 @@ static BOOL allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char
if (i > 2) {
DEBUG(0, ("allocate_print_jobid: failed to allocate a print job for queue %s\n",
printername ));
+ /* Probably full... */
+ errno = ENOSPC;
return False;
}
@@ -1669,13 +1671,16 @@ uint32 print_job_start(struct current_user *user, int snum, char *jobname, NT_DE
/* Insure the maximum queue size is not violated */
if ((njobs = print_queue_length(snum,NULL)) > lp_maxprintjobs(snum)) {
- DEBUG(3, ("print_job_start: number of jobs (%d) larger than max printjobs per queue (%d).\n",
- njobs, lp_maxprintjobs(snum) ));
+ DEBUG(3, ("print_job_start: Queue %s number of jobs (%d) larger than max printjobs per queue (%d).\n",
+ printername, njobs, lp_maxprintjobs(snum) ));
release_print_db(pdb);
errno = ENOSPC;
return (uint32)-1;
}
+ DEBUG(10,("print_job_start: Queue %s number of jobs (%d), max printjobs = %d\n",
+ printername, njobs, lp_maxprintjobs(snum) ));
+
if (!allocate_print_jobid(pdb, snum, printername, &jobid))
goto fail;