str = argv_concat(argv, argc, 0);
- if ((ws = XMALLOC(MTYPE_TMP, sizeof(*ws))) == NULL) {
- zlog_err("%s: unable to allocate work_state", __func__);
- return CMD_WARNING;
- }
+ ws = XMALLOC(MTYPE_TMP, sizeof(*ws));
- if (!(ws->str = XSTRDUP(MTYPE_TMP, str))) {
- zlog_err("%s: unable to xstrdup", __func__);
- XFREE(MTYPE_TMP, ws);
- return CMD_WARNING;
- }
+ ws->str = XSTRDUP(MTYPE_TMP, str);
ws->vty = vty;
ws->i = ITERS_FIRST;
{
struct heavy_wq_node *hn;
- if ((hn = XCALLOC(MTYPE_WQ_NODE, sizeof(struct heavy_wq_node)))
- == NULL) {
- zlog_err("%s: unable to allocate hn", __func__);
- return;
- }
+ hn = XCALLOC(MTYPE_WQ_NODE, sizeof(struct heavy_wq_node));
hn->i = i;
- if (!(hn->str = XSTRDUP(MTYPE_WQ_NODE_STR, str))) {
- zlog_err("%s: unable to xstrdup", __func__);
- XFREE(MTYPE_WQ_NODE, hn);
- return;
- }
+ hn->str = XSTRDUP(MTYPE_WQ_NODE_STR, str);
work_queue_add(heavy_wq, hn);
static int heavy_wq_init()
{
- if (!(heavy_wq = work_queue_new(master, "heavy_work_queue"))) {
- zlog_err("%s: could not get new work queue!", __func__);
- return -1;
- }
+ heavy_wq = work_queue_new(master, "heavy_work_queue");
heavy_wq->spec.workfunc = &slow_func;
heavy_wq->spec.errorfunc = &slow_func_err;