Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
talla
enacl
Commits
2542342b
Unverified
Commit
2542342b
authored
Mar 18, 2016
by
Alexander Færøy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle NIF upgrade gracefully.
parent
d384d860
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
c_src/enacl_nif.c
c_src/enacl_nif.c
+7
-1
No files found.
c_src/enacl_nif.c
View file @
2542342b
...
...
@@ -20,6 +20,12 @@ int enif_crypto_load(ErlNifEnv *env, void **priv_data, ERL_NIF_TERM load_info) {
return
sodium_init
()
>=
0
?
0
:
1
;
}
/* Upgrade */
static
int
enif_crypto_upgrade
(
ErlNifEnv
*
env
,
void
**
priv_data
,
void
**
old_priv_data
,
ERL_NIF_TERM
load_info
)
{
return
0
;
}
/* Low-level functions (Hashing, String Equality, ...) */
static
...
...
@@ -1101,4 +1107,4 @@ static ErlNifFunc nif_funcs[] = {
{
"scramble_block_16"
,
2
,
enif_scramble_block_16
}
};
ERL_NIF_INIT
(
enacl_nif
,
nif_funcs
,
enif_crypto_load
,
NULL
,
NULL
,
NULL
);
ERL_NIF_INIT
(
enacl_nif
,
nif_funcs
,
enif_crypto_load
,
/* reload */
NULL
,
enif_crypto_upgrade
,
/* unload */
NULL
);
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