[SCM] Samba Shared Repository - branch v3-4-test updated -
release-4-0-0alpha7-949-gdcf3148
Jeremy Allison
jra at samba.org
Tue May 12 00:33:53 GMT 2009
The branch, v3-4-test has been updated
via dcf314874e90ec9debf1582fc3f6b07f2d4d30ca (commit)
via a63e966ce64d262ae9a032c73915a398a5c174f8 (commit)
from 99ae1159fe885cf57ec5cd964febca2eca5def61 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test
- Log -----------------------------------------------------------------
commit dcf314874e90ec9debf1582fc3f6b07f2d4d30ca
Author: Jeremy Allison <jra at samba.org>
Date: Mon May 11 17:29:48 2009 -0700
Hopefully fix the buildfarm. Add some debug level 10 messages
I used to track down the vlp problem, change the vlp test printer
not to use a static path of /tmp/vlp.tdb for the virtual print
database (as this will eventually fill up). Cause it to use
a virtual print database inside the cachepath.
Jeremy.
commit a63e966ce64d262ae9a032c73915a398a5c174f8
Author: Jeremy Allison <jra at samba.org>
Date: Mon May 11 17:29:16 2009 -0700
Ensure documentation matches the tdb_util function usage.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
lib/util/util_tdb.c | 4 ++--
source3/printing/printing.c | 8 +++++++-
source3/printing/tests/vlp.c | 17 +++++++++++++----
3 files changed, 22 insertions(+), 7 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/util_tdb.c b/lib/util/util_tdb.c
index 2d6012c..e107cbd 100644
--- a/lib/util/util_tdb.c
+++ b/lib/util/util_tdb.c
@@ -152,7 +152,7 @@ int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v)
}
/****************************************************************************
- Fetch a uint32_t value by a arbitrary blob key, return -1 if not found.
+ Fetch a uint32_t value by a arbitrary blob key, return false if not found.
Output is uint32_t in native byte order.
****************************************************************************/
@@ -172,7 +172,7 @@ bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *va
}
/****************************************************************************
- Fetch a uint32_t value by string key, return -1 if not found.
+ Fetch a uint32_t value by string key, return false if not found.
Output is uint32_t in native byte order.
****************************************************************************/
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index e410c1c..69466ba 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -2313,11 +2313,15 @@ static bool allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char
if (tdb_error(pdb->tdb) != TDB_ERR_NOEXIST) {
DEBUG(0, ("allocate_print_jobid: failed to fetch INFO/nextjob for print queue %s\n",
sharename));
+ tdb_unlock_bystring(pdb->tdb, "INFO/nextjob");
return False;
}
+ DEBUG(10,("allocate_print_jobid: no existing jobid in %s\n", sharename));
jobid = 0;
}
+ DEBUG(10,("allocate_print_jobid: read jobid %u from %s\n", jobid, sharename));
+
jobid = NEXT_JOBID(jobid);
if (tdb_store_int32(pdb->tdb, "INFO/nextjob", jobid)==-1) {
@@ -2329,8 +2333,10 @@ static bool allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char
/* We've finished with the INFO/nextjob lock. */
tdb_unlock_bystring(pdb->tdb, "INFO/nextjob");
- if (!print_job_exists(sharename, jobid))
+ if (!print_job_exists(sharename, jobid)) {
break;
+ }
+ DEBUG(10,("allocate_print_jobid: found jobid %u in %s\n", jobid, sharename));
}
if (i > 2) {
diff --git a/source3/printing/tests/vlp.c b/source3/printing/tests/vlp.c
index 286e4a4..ec610d9 100644
--- a/source3/printing/tests/vlp.c
+++ b/source3/printing/tests/vlp.c
@@ -21,7 +21,6 @@
#include "includes.h"
-#define PRINT_TDB "/tmp/vlp.tdb"
#define PRINT_FIRSTJOB "100"
static TDB_CONTEXT *tdb;
@@ -376,6 +375,7 @@ static int lpresume_command(int argc, char **argv)
int main(int argc, char **argv)
{
/* Parameter check */
+ char *printdb_path = NULL;
if (argc == 1) {
usage();
@@ -384,15 +384,24 @@ int main(int argc, char **argv)
/* Initialise */
- if (!(tdb = tdb_open(PRINT_TDB, 0, 0, O_RDWR | O_CREAT,
+#if 0
+ printdb_path = "/tmp/vlp.tdb";
+#else
+ if (asprintf(&printdb_path, "%svlp.tdb",
+ cache_path("printing/"))) {
+ return 1;
+ }
+#endif
+
+ if (!(tdb = tdb_open(printdb_path, 0, 0, O_RDWR | O_CREAT,
0666))) {
- printf("%s: unable to open %s\n", argv[0], PRINT_TDB);
+ printf("%s: unable to open %s\n", argv[0], printdb_path);
return 1;
}
/* Ensure we are modes 666 */
- chmod(PRINT_TDB, 0666);
+ chmod(printdb_path, 0666);
/* Do commands */
--
Samba Shared Repository
More information about the samba-cvs
mailing list