pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/lib Remove EXPECT_DEBUG cod...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2b4814fef64
branches:  trunk
changeset: 533399:c2b4814fef64
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Sep 18 15:40:47 2007 +0000

description:
Remove EXPECT_DEBUG code and if(0)'ed call of setbuf.

diffstat:

 pkgtools/pkg_install/files/lib/ftpio.c |  52 +--------------------------------
 1 files changed, 2 insertions(+), 50 deletions(-)

diffs (112 lines):

diff -r ea01eae4708f -r c2b4814fef64 pkgtools/pkg_install/files/lib/ftpio.c
--- a/pkgtools/pkg_install/files/lib/ftpio.c    Tue Sep 18 15:38:10 2007 +0000
+++ b/pkgtools/pkg_install/files/lib/ftpio.c    Tue Sep 18 15:40:47 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpio.c,v 1.24 2007/08/12 16:47:18 joerg Exp $ */
+/*     $NetBSD: ftpio.c,v 1.25 2007/09/18 15:40:47 joerg Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.24 2007/08/12 16:47:18 joerg Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.25 2007/09/18 15:40:47 joerg Exp $");
 #endif
 
 /*-
@@ -128,11 +128,6 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef EXPECT_DEBUG
-#if HAVE_VIS_H
-#include <vis.h>
-#endif
-#endif
 
 #include "../lib/lib.h"
 
@@ -155,9 +150,6 @@
 } fds;
 
 
-#if EXPECT_DEBUG
-static int      expect_debug = 1;
-#endif /* EXPECT_DEBUG */
 static int      needclose=0;
 static int      ftp_started=0;
 static fds      ftpio;
@@ -183,9 +175,6 @@
 {
        int rc;
        char buf[256];  
-#if EXPECT_DEBUG
-       char *vstr;
-#endif /* EXPECT_DEBUG */
        regex_t rstr;
        int done;
        struct pollfd set[1];
@@ -193,23 +182,9 @@
        regmatch_t match;
        int verbose_expect=0;
 
-#if EXPECT_DEBUG
-       vstr=malloc(2*sizeof(buf));
-       if (vstr == NULL)
-               err(EXIT_FAILURE, "expect: malloc() failed");
-       strvis(vstr, str, VIS_NL|VIS_SAFE|VIS_CSTYLE);
-#endif /* EXPECT_DEBUG */
-           
        if (regcomp(&rstr, str, REG_EXTENDED) != 0)
                err(EXIT_FAILURE, "expect: regcomp() failed");
 
-#if EXPECT_DEBUG
-       if (expect_debug)
-               printf("expecting \"%s\" on fd %d ...\n", vstr, fd);
-#endif /* EXPECT_DEBUG */
-
-       if(0) setbuf(stdout, NULL);
-
        memset(buf, '\n', sizeof(buf));
 
        done=0;
@@ -264,23 +239,7 @@
                        if (verbose_expect)
                                putchar(buf[sizeof(buf)-1]);
 
-#if EXPECT_DEBUG
-                       {
-                               char *v=malloc(2*sizeof(buf));
-                               strvis(v, buf, VIS_NL|VIS_SAFE|VIS_CSTYLE);
-                               if (expect_debug)
-                                       printf("expect=<%s>, buf=<%*s>\n", vstr, strlen(v), v);
-                               free(v);
-                       }
-#endif /* EXPECT_DEBUG */
-
                        if (regexec(&rstr, buf, 1, &match, 0) == 0) {
-#if EXPECT_DEBUG
-                               if (expect_debug)
-                                       printf("Gotcha -> %s!\n", buf+match.rm_so+1);
-                               fflush(stdout);
-#endif /* EXPECT_DEBUG */
-
                                if (ftprc && isdigit((unsigned char)buf[match.rm_so+1])) 
                                        *ftprc = atoi(buf+match.rm_so+1);
 
@@ -293,13 +252,6 @@
                }
        }
 
-#if EXPECT_DEBUG
-       printf("done.\n");
-
-       if (str)
-               free(vstr);
-#endif /* EXPECT_DEBUG */
-
        return retval;
 }
 



Home | Main Index | Thread Index | Old Index