summaryrefslogtreecommitdiff
path: root/c_src
diff options
context:
space:
mode:
authorPeter Lemenkov <lemenkov@redhat.com>2016-09-21 17:57:25 +0200
committerPeter Lemenkov <lemenkov@redhat.com>2016-09-21 17:57:25 +0200
commit95513198dcabd8c6e28b75d0c9966ce9f02c5fcc (patch)
tree257333187e7c078fa4ba29a8129d25a7a7fb4a73 /c_src
parente7e0e17f74553c038ec3b1608431cf17a5a87646 (diff)
downloaderlang-sd_notify-95513198dcabd8c6e28b75d0c9966ce9f02c5fcc.tar.gz
Remove duplicated code
Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>
Diffstat (limited to 'c_src')
-rw-r--r--c_src/sd_notify.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/c_src/sd_notify.c b/c_src/sd_notify.c
index 63346b9..bf4e9df 100644
--- a/c_src/sd_notify.c
+++ b/c_src/sd_notify.c
@@ -24,23 +24,6 @@ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "erl_nif.h"
#include <systemd/sd-daemon.h>
-static ERL_NIF_TERM sd_notify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{
- int unset_environment = 0;
- enif_get_int(env, argv[0], &unset_environment);
-
- unsigned int length = 0;
- enif_get_list_length(env, argv[1], &length);
-
- char* state = (char*)enif_alloc(++length);
- enif_get_string(env, argv[1], state, length, ERL_NIF_LATIN1);
- int result = sd_notify(unset_environment, state);
- enif_free(state);
-
- return enif_make_int(env, result);
-}
-
-
static ERL_NIF_TERM sd_pid_notify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
int pid = 0;
@@ -63,7 +46,6 @@ static ERL_NIF_TERM sd_pid_notify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TE
static ErlNifFunc nif_funcs[] =
{
- {"sd_notify", 2, sd_notify_nif},
{"sd_pid_notify", 3, sd_pid_notify_nif},
};