aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2012-01-08 16:22:18 +0100
committerPaulK <contact@paulk.fr>2012-01-08 16:22:18 +0100
commitbedac849cbc7c5bbcaffa878a2e0c1c3305b25d4 (patch)
treecd17fb948762c792fe1293c371f7c42feb6d6f28
parent8d9a2ec18e6da0dd77a72dd354aaac07a5f0c6b7 (diff)
downloadexternal_libsamsung-ipc-bedac849cbc7c5bbcaffa878a2e0c1c3305b25d4.zip
external_libsamsung-ipc-bedac849cbc7c5bbcaffa878a2e0c1c3305b25d4.tar.gz
external_libsamsung-ipc-bedac849cbc7c5bbcaffa878a2e0c1c3305b25d4.tar.bz2
Fixed tests on various handlers-related functions
-rw-r--r--samsung-ipc/ipc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index 15e2645..17b943b 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -73,7 +73,9 @@ struct ipc_client* ipc_client_new(int client_type)
client->ops = ops;
client->handlers = (struct ipc_handlers *) malloc(sizeof(struct ipc_handlers));
client->log_handler = log_handler_default;
+
memcpy(client->handlers, &ipc_default_handlers, sizeof(struct ipc_handlers));
+
return client;
}
@@ -174,7 +176,7 @@ int ipc_client_close(struct ipc_client *client)
{
if (client == NULL ||
client->handlers == NULL ||
- client->handlers->open == NULL)
+ client->handlers->close == NULL)
return -1;
return client->handlers->close(NULL, 0, client->handlers->close_data);
@@ -184,7 +186,7 @@ int ipc_client_power_on(struct ipc_client *client)
{
if (client == NULL ||
client->handlers == NULL ||
- client->handlers->open == NULL)
+ client->handlers->power_on == NULL)
return -1;
return client->handlers->power_on(client->handlers->power_on_data);
@@ -194,7 +196,7 @@ int ipc_client_power_off(struct ipc_client *client)
{
if (client == NULL ||
client->handlers == NULL ||
- client->handlers->open == NULL)
+ client->handlers->power_off == NULL)
return -1;
return client->handlers->power_off(client->handlers->power_off_data);