/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.tizenopensource.org/license
+ * http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include <packet.h>
#include <com-core_packet.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "dlist.h"
if (packet_get(packet, "i", &ret) != 1) {
ErrPrint("Invalid result packet\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
DbgPrint("[%s] Returns: %d\n", packet_command(packet), ret);
command = create_command(handler, packet);
if (!command) {
ErrPrint("Failed to create a command\n");
- if (ret_cb)
- ret_cb(handler, NULL, data);
-
packet_unref(packet);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
command->ret_cb = ret_cb;
push_command(command);
packet_unref(packet);
- return 0;
+ return LB_STATUS_SUCCESS;
}
int master_rpc_request_only(struct livebox *handler, struct packet *packet)
if (!command) {
ErrPrint("Failed to create a command\n");
packet_unref(packet);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
command->ret_cb = NULL;
push_command(command);
packet_unref(packet);
- return 0;
+ return LB_STATUS_SUCCESS;
}
int master_rpc_clear_fault_package(const char *pkgname)
struct command *command;
if (!pkgname)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
DbgPrint("Clear requests of the fault package(%s)\n", pkgname);
if (result) {
if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid result packet\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
packet_unref(result);
} else {
ErrPrint("Failed to send a sync request\n");
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
}
packet_unref(packet);