save works
This commit is contained in:
parent
b748e30d20
commit
f4b1ba4cd7
21 changed files with 373 additions and 324 deletions
|
|
@ -19,12 +19,7 @@ queue_t* create_queue(cluster_t* c, xce_queue_t* p)
|
|||
{
|
||||
queue_t* q;
|
||||
|
||||
q = calloc(1, sizeof(*q));
|
||||
if (q == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
q->queue = makeQueue(p);
|
||||
q = makeQueue(c->qmgr, p);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
|
@ -72,28 +67,28 @@ int queue_ctrl(cluster_t* c, xce_queuectrl_t* ctrl)
|
|||
|
||||
switch (ctrl->action) {
|
||||
case QUEUE_OPEN:
|
||||
if (!(q->queue->status & QUEUE_STAT_CLOSED)) {
|
||||
if (!(q->queue.status & QUEUE_STAT_CLOSED)) {
|
||||
goto clean;
|
||||
}
|
||||
q->queue->status &= ~QUEUE_STAT_CLOSED;
|
||||
q->queue.status &= ~QUEUE_STAT_CLOSED;
|
||||
break;
|
||||
case QUEUE_CLOSE:
|
||||
if (q->queue->status & QUEUE_STAT_CLOSED) {
|
||||
if (q->queue.status & QUEUE_STAT_CLOSED) {
|
||||
goto clean;
|
||||
}
|
||||
q->queue->status |= QUEUE_STAT_CLOSED;
|
||||
q->queue.status |= QUEUE_STAT_CLOSED;
|
||||
break;
|
||||
case QUEUE_INACTIVE:
|
||||
if (q->queue->status & QUEUE_STAT_INACT_ADMIN) {
|
||||
if (q->queue.status & QUEUE_STAT_INACT_ADMIN) {
|
||||
goto clean;
|
||||
}
|
||||
q->queue->status |= QUEUE_STAT_INACT_ADMIN;
|
||||
q->queue.status |= QUEUE_STAT_INACT_ADMIN;
|
||||
break;
|
||||
case QUEUE_ACTIVE:
|
||||
if (!(q->queue->status & QUEUE_STAT_INACT_ADMIN)) {
|
||||
if (!(q->queue.status & QUEUE_STAT_INACT_ADMIN)) {
|
||||
goto clean;
|
||||
}
|
||||
q->queue->status &= ~QUEUE_STAT_INACT_ADMIN;
|
||||
q->queue.status &= ~QUEUE_STAT_INACT_ADMIN;
|
||||
break;
|
||||
default:
|
||||
rc = -1;
|
||||
|
|
@ -147,14 +142,14 @@ int get_queue_exec(cluster_t* c, char* queue, char** pre_exec, char** post_exec)
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (q->queue->pre_exec != NULL) {
|
||||
*pre_exec = makeString(q->queue->pre_exec);
|
||||
if (q->queue.pre_exec != NULL) {
|
||||
*pre_exec = makeString(q->queue.pre_exec);
|
||||
} else {
|
||||
*pre_exec = NULL;
|
||||
}
|
||||
|
||||
if (q->queue->post_exec != NULL) {
|
||||
*post_exec = makeString(q->queue->post_exec);
|
||||
if (q->queue.post_exec != NULL) {
|
||||
*post_exec = makeString(q->queue.post_exec);
|
||||
} else {
|
||||
*post_exec = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue