summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2007-09-18 15:40:47 +0000
committerjoerg <joerg@pkgsrc.org>2007-09-18 15:40:47 +0000
commit50468456879e7e81b45fd2f84da6eabb8bb214cc (patch)
treed5924c725a88b5be62ed3b29f9963acdab0a5f24 /pkgtools
parent7177f144cd59d28e300a5ada88b7d472fc37a75c (diff)
downloadpkgsrc-50468456879e7e81b45fd2f84da6eabb8bb214cc.tar.gz
Remove EXPECT_DEBUG code and if(0)'ed call of setbuf.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/lib/ftpio.c52
1 files changed, 2 insertions, 50 deletions
diff --git a/pkgtools/pkg_install/files/lib/ftpio.c b/pkgtools/pkg_install/files/lib/ftpio.c
index 37b6e064ece..6fe73e6a657 100644
--- a/pkgtools/pkg_install/files/lib/ftpio.c
+++ b/pkgtools/pkg_install/files/lib/ftpio.c
@@ -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 @@ __RCSID("$NetBSD: ftpio.c,v 1.24 2007/08/12 16:47:18 joerg Exp $");
#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 @@ typedef struct {
} 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 @@ expect(int fd, const char *str, int *ftprc)
{
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 @@ expect(int fd, const char *str, int *ftprc)
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 @@ expect(int fd, const char *str, int *ftprc)
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 @@ expect(int fd, const char *str, int *ftprc)
}
}
-#if EXPECT_DEBUG
- printf("done.\n");
-
- if (str)
- free(vstr);
-#endif /* EXPECT_DEBUG */
-
return retval;
}