OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_config.c versions 1.65 and 1.66
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.65 -> 1.66

--- lmtp2nntp_config.c   2002/03/06 14:26:33     1.65
+++ lmtp2nntp_config.c   2002/03/13 13:58:39     1.66
@@ -119,7 +119,6 @@
 {
     ex_t ex;
     optionval_t *ov;
-    //char *cp;
     int rc;
 
     /* create L2 environment */
@@ -148,11 +147,29 @@
         CU(ERR_EXECUTION);
     }
     if (ov->data.s != NULL) {
+        l2_channel_t *ch;
+
+        if (l2_env_handler(ctx->l2_env, &l2_handler_var) != L2_OK) {
+            fprintf(stderr, "%s:Error: logging failed to register \"%s\" handler \n", ctx->progname, l2_handler_var.name);
+            CU(ERR_EXECUTION);
+        }
+        if ((rc = l2_channel_create(&ctx->l2, ctx->l2_env, l2_handler_var.name)) != L2_OK) {
+            fprintf(stderr, "%s:Error: logging failed to create \"%s\" channel\n", ctx->progname, l2_handler_var.name);
+            CU(ERR_EXECUTION);
+        }
+        if ((rc = l2_channel_configure(ctx->l2, "", ctx->config_varctx)) != L2_OK) {
+            fprintf(stderr, "%s:Error: logging failed to configure \"%s\" channel\n", ctx->progname, l2_handler_var.name);
+            CU(ERR_EXECUTION);
+        }
         //FIXME this is cut off on command line!? fprintf(stderr, "DEBUG: ov->data.s = \"%s\"\n", ov->data.s);
-        if ((rc = l2_spec(&ctx->l2, ctx->l2_env, ov->data.s)) != L2_OK) {
+        if ((rc = l2_spec(&ch, ctx->l2_env, ov->data.s)) != L2_OK) {
             fprintf(stderr, "%s:Error: logging failed to create stream\n", ctx->progname);
             CU(ERR_EXECUTION);
         }
+        if (l2_channel_link(ctx->l2, L2_LINK_CHILD, ch, NULL) != L2_OK) {
+            fprintf(stderr, "%s:Error: logging failed to link child channel\n", ctx->progname);
+            CU(ERR_EXECUTION);
+        }
         if (l2_channel_levels(ctx->l2, L2_LEVEL_ALL, L2_LEVEL_NONE) != L2_OK) { /* FIXME should this globalmask and flushmask be user-configurable? */
             fprintf(stderr, "%s:Error: logging failed to set global logging level\n", ctx->progname);
             CU(ERR_EXECUTION);

CVSTrac 2.0.1