summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-05 22:32:15 +0000
committerJeremy Allison <jra@samba.org>2002-12-05 22:32:15 +0000
commit6eb27e4f0dea6027ba9e041348f066c947e751c6 (patch)
treea3ce57b8e8333a02c2eeb5d921b43607ce0c56a2
parent6e2f0c4e304a09313f933a3c9c2a7b3a0219006d (diff)
downloadsamba-6eb27e4f0dea6027ba9e041348f066c947e751c6.tar.gz
samba-6eb27e4f0dea6027ba9e041348f066c947e751c6.tar.xz
samba-6eb27e4f0dea6027ba9e041348f066c947e751c6.zip
Fix debugs for rap mapping. Delete job on map fail.
Jeremy.
-rw-r--r--source/printing/printfsp.c3
-rw-r--r--source/printing/printing.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/source/printing/printfsp.c b/source/printing/printfsp.c
index 4ae74e27ec5..f028e1f564a 100644
--- a/source/printing/printfsp.c
+++ b/source/printing/printfsp.c
@@ -55,7 +55,8 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname)
/* Convert to RAP id. */
fsp->rap_print_jobid = pjobid_to_rap(SNUM(conn), jobid);
if (fsp->rap_print_jobid == 0) {
- /* We need to delete the entry in the tdb here ! FIXME ! JRA */
+ /* We need to delete the entry in the tdb. */
+ pjob_delete(SNUM(conn), jobid);
file_free(fsp);
return NULL;
}
diff --git a/source/printing/printing.c b/source/printing/printing.c
index 6c70b3deaed..cde16461077 100644
--- a/source/printing/printing.c
+++ b/source/printing/printing.c
@@ -71,6 +71,9 @@ uint16 pjobid_to_rap(int snum, uint32 jobid)
if (data.dptr && data.dsize == sizeof(uint16)) {
memcpy(&rap_jobid, data.dptr, sizeof(uint16));
SAFE_FREE(data.dptr);
+ DEBUG(10,("pjobid_to_rap: jobid %u maps to RAP jobid %u\n",
+ (unsigned int)jobid,
+ (unsigned int)rap_jobid));
return rap_jobid;
}
SAFE_FREE(data.dptr);
@@ -83,7 +86,7 @@ uint16 pjobid_to_rap(int snum, uint32 jobid)
tdb_store(rap_tdb, key, data, TDB_REPLACE);
tdb_store(rap_tdb, data, key, TDB_REPLACE);
- DEBUG(10,("pjobid_to_rap: jobid %u maps to RAP jobid %u\n",
+ DEBUG(10,("pjobid_to_rap: created jobid %u maps to RAP jobid %u\n",
(unsigned int)jobid,
(unsigned int)rap_jobid));
return rap_jobid;
@@ -516,7 +519,7 @@ done:
Remove a job structure from the database.
****************************************************************************/
-static void pjob_delete(int snum, uint32 jobid)
+void pjob_delete(int snum, uint32 jobid)
{
struct printjob *pjob = print_job_find(snum, jobid);
uint32 job_status = 0;