Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
25df419c
Commit
25df419c
authored
Jul 24, 2016
by
Paul Sokolovsky
Browse files
extmod/modbtree: Check __bt_open() return value for error.
parent
0d221775
Changes
1
Hide whitespace changes
Inline
Side-by-side
extmod/modbtree.c
View file @
25df419c
...
...
@@ -331,6 +331,9 @@ STATIC mp_obj_t mod_btree_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t
MP_ARRAY_SIZE
(
allowed_args
),
allowed_args
,
(
mp_arg_val_t
*
)
&
args
);
DB
*
db
=
__bt_open
(
fname
,
/*flags*/
O_CREAT
|
O_RDWR
,
/*mode*/
0770
,
/*openinfo*/
NULL
,
/*dflags*/
0
);
if
(
db
==
NULL
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
errno
)));
}
return
MP_OBJ_FROM_PTR
(
btree_new
(
db
));
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_KW
(
mod_btree_open_obj
,
1
,
mod_btree_open
);
...
...
Write
Preview
Supports
Markdown
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