rd_agent_t * rd_new (struct ps_prochandle *php) { struct rd_agent *agent = malloc (sizeof (struct rd_agent)); if (!agent) return NULL; agent->rd_php = php; if (rd_reset (agent) != RD_OK) { free (agent); return NULL; } return agent; }
rd_agent_t * rd_new(struct ps_prochandle *php) { rd_agent_t *rap; LOG(ps_plog(MSG_ORIG(MSG_DB_RDNEW), php)); if ((rap = (rd_agent_t *)calloc(sizeof (rd_agent_t), 1)) == NULL) return (0); rap->rd_psp = php; (void) mutex_init(&rap->rd_mutex, USYNC_THREAD, 0); if (rd_reset(rap) != RD_OK) { if (rap->rd_helper.rh_dlhandle != NULL) { rap->rd_helper.rh_ops->rho_fini(rap->rd_helper.rh_data); (void) dlclose(rap->rd_helper.rh_dlhandle); } free(rap); LOG(ps_plog(MSG_ORIG(MSG_DB_RESETFAIL))); return ((rd_agent_t *)0); } return (rap); }