예제 #1
0
/*
 * Abandons the saving of a product which was begun using pqe_new() and
 * releases any allocated resources.
 *
 * pq                The product queue. (in/out)
 * index             The index of the product begun by pqe_new(...). (in)
 *
 * Returns:
 *   pq.h:ENOERR     if success.
 *   errno.h:EINVAL  if the queue is NULL or not open.
 */
int pqe_discard(
    pqueue*   pq,
    pqe_index index)
{
    int status = checkOpen(pq);

    if (status == ENOERR) {
        if(!pqeIsNone(index))
            free((void*)index.offset);
    }

    return status;
}
예제 #2
0
파일: pqinsert.c 프로젝트: khallock/LDM
void
cleanup(void)
{
    if (pq) {
#if !USE_MMAP
        if (!pqeIsNone(pqeIndex))
            (void)pqe_discard(pq, pqeIndex);
#endif

        (void) pq_close(pq);
        pq = NULL;
    }

    (void)closeulog();
}