Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
47c18140
...
47c18140b870504d9ce4d4c386530c1a73dccfe2
authored
2011-11-09 23:38:52 +0200
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implement _dbm_get_fd in Kyoto cabinet.
* libmu_dbm/kyoto.c: Implement _dbm_get_fd.
1 parent
df905e61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
libmu_dbm/kyoto.c
libmu_dbm/kyoto.c
View file @
47c1814
...
...
@@ -19,6 +19,7 @@
# include <config.h>
#endif
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
...
...
@@ -38,6 +39,7 @@ struct kc_descr
{
KCDB
*
db
;
/* db */
KCCUR
*
cur
;
/* cursor */
int
fd
;
};
static
int
...
...
@@ -49,7 +51,17 @@ _kc_file_safety (mu_dbm_file_t db, int mode, uid_t owner)
int
_kc_get_fd
(
mu_dbm_file_t
db
,
int
*
pag
,
int
*
dir
)
{
return
ENOSYS
;
struct
kc_descr
*
kcd
=
db
->
db_descr
;
if
(
kcd
->
fd
==
-
1
)
{
kcd
->
fd
=
open
(
db
->
db_name
,
O_RDONLY
);
if
(
kcd
->
fd
==
-
1
)
return
errno
;
}
*
pag
=
kcd
->
fd
;
if
(
dir
)
*
dir
=
kcd
->
fd
;
return
0
;
}
static
int
...
...
@@ -93,6 +105,7 @@ _kc_open (mu_dbm_file_t db, int flags, int mode)
kcd
->
db
=
kdb
;
kcd
->
cur
=
NULL
;
db
->
db_descr
=
kcd
;
kcd
->
fd
=
-
1
;
return
0
;
}
...
...
@@ -102,6 +115,8 @@ _kc_close (mu_dbm_file_t db)
if
(
db
->
db_descr
)
{
struct
kc_descr
*
kcd
=
db
->
db_descr
;
if
(
kcd
->
fd
!=
-
1
)
close
(
kcd
->
fd
);
kcdbclose
(
kcd
->
db
);
kcdbdel
(
kcd
->
db
);
free
(
kcd
);
...
...
Please
register
or
sign in
to post a comment