return NULL;
}
-static inline __attribute__((always_inline)) int debug_mode_enabled(int pid, const char *slavename, const char *pkgname, int secured, const char *abi, const char *acceleration)
+static inline __attribute__((always_inline)) struct slave_node *debug_mode_enabled(int pid, const char *slavename, const char *pkgname, int secured, const char *abi, const char *acceleration)
{
struct slave_node *slave;
if (!slave) {
slave = slave_create(slavename, secured, abi, pkgname, 0, acceleration, 0);
if (!slave) {
- return WIDGET_ERROR_FAULT;
+ return NULL;
}
DbgPrint("New slave is created net(%d) abi(%s) secured(%d) accel(%s)\n", 0, abi, secured, acceleration);
slave_set_valid(slave);
DbgPrint("Provider is forcely activated, pkgname(%s), abi(%s), slavename(%s)\n", pkgname, abi, slavename);
- return WIDGET_ERROR_NONE;
+ return slave;
}
static struct packet *slave_hello(pid_t pid, int handle, const struct packet *packet) /* slave_name, ret */
if (!slave) {
if (WIDGET_CONF_DEBUG_MODE || g_conf.debug_mode) {
- if (debug_mode_enabled(pid, slavename, pkgname, secured, abi, acceleration) != WIDGET_ERROR_NONE) {
+ slave = debug_mode_enabled(pid, slavename, pkgname, secured, abi, acceleration);
+ if (!slave) {
ErrPrint("Failed to create a new slave for %s\n", slavename);
goto out;
}
if (!slave) {
if (WIDGET_CONF_DEBUG_MODE || g_conf.debug_mode) {
- if (debug_mode_enabled(pid, slavename, pkgname, secured, abi, acceleration) != WIDGET_ERROR_NONE) {
+ slave = debug_mode_enabled(pid, slavename, pkgname, secured, abi, acceleration);
+ if (!slave) {
ErrPrint("Failed to create a new slave for %s\n", slavename);
goto out;
}