Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
91436a25
Commit
91436a25
authored
Aug 31, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: return TDB_ERR_RDONLY if trying to start a transaction on a R/O tdb.
This is more accurate than returning TDB_ERR_EINVAL.
parent
6b7c3c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ccan/tdb2/transaction.c
ccan/tdb2/transaction.c
+11
-2
No files found.
ccan/tdb2/transaction.c
View file @
91436a25
...
@@ -523,13 +523,22 @@ enum TDB_ERROR tdb_transaction_start(struct tdb_context *tdb)
...
@@ -523,13 +523,22 @@ enum TDB_ERROR tdb_transaction_start(struct tdb_context *tdb)
tdb
->
stats
.
transactions
++
;
tdb
->
stats
.
transactions
++
;
/* some sanity checks */
/* some sanity checks */
if
(
tdb
->
read_only
||
(
tdb
->
flags
&
TDB_INTERNAL
)
)
{
if
(
tdb
->
flags
&
TDB_INTERNAL
)
{
return
tdb
->
last_error
=
tdb_logerr
(
tdb
,
TDB_ERR_EINVAL
,
return
tdb
->
last_error
=
tdb_logerr
(
tdb
,
TDB_ERR_EINVAL
,
TDB_LOG_USE_ERROR
,
"tdb_transaction_start:"
" cannot start a"
" transaction on an"
" internal tdb"
);
}
if
(
tdb
->
read_only
)
{
return
tdb
->
last_error
=
tdb_logerr
(
tdb
,
TDB_ERR_RDONLY
,
TDB_LOG_USE_ERROR
,
TDB_LOG_USE_ERROR
,
"tdb_transaction_start:"
"tdb_transaction_start:"
" cannot start a"
" cannot start a"
" transaction on a "
" transaction on a "
"
read-only or internal
db"
);
"
read-only t
db"
);
}
}
/* cope with nested tdb_transaction_start() calls */
/* cope with nested tdb_transaction_start() calls */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment