--- l2_ch_file.c 2001/09/05 07:47:12 1.13
+++ l2_ch_file.c 2001/09/06 14:37:53 1.14
@@ -48,7 +48,7 @@
/* allocate private channel configuration */
if ((cfg = (l2_ch_file_t *)malloc(sizeof(l2_ch_file_t))) == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
/* initialize configuration with reasonable defaults */
cfg->fd = -1;
@@ -71,7 +71,7 @@
/* parameter checks */
if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
/* feed and call generic parameter parsing engine */
L2_PARAM_SET(pa[0], path, CHARPTR, &cfg->path);
@@ -91,16 +91,16 @@
/* parameter checks */
if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
if (cfg->path == NULL)
- return L2_ERROR;
+ return L2_ERR_USE;
/* open channel file */
mode = O_WRONLY|O_CREAT;
if (cfg->append)
mode |= O_APPEND;
if ((cfg->fd = open(cfg->path, mode, cfg->perm)) == -1)
- return L2_ERROR;
+ return L2_ERR_SYS;
return L2_OK;
}
@@ -113,13 +113,13 @@
/* parameter checks */
if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
if (cfg->fd == -1)
- return L2_ERROR;
+ return L2_ERR_USE;
/* write message to channel file */
if (write(cfg->fd, buf, buf_size) == -1)
- return L2_ERROR;
+ return L2_ERR_SYS;
return L2_OK;
}
@@ -139,9 +139,9 @@
/* parameter checks */
if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
if (cfg->fd == -1)
- return L2_ERROR;
+ return L2_ERR_USE;
/* close channel file */
close(cfg->fd);
@@ -155,7 +155,7 @@
{
/* parameter checks */
if (ctx->vp == NULL)
- return L2_ERROR;
+ return L2_ERR_ARG;
/* destroy channel configuration */
free(ctx->vp);
|