[Pkg-wmaker-commits] [wmbiff] 21/77: extra debugging messages, to be in-line with our -debug to stdout philosophy

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:01:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_0
in repository wmbiff.

commit ee50ed05f491e93092bb544d5d05139375ac5048
Author: bluehal <bluehal>
Date:   Fri Apr 12 05:54:36 2002 +0000

    extra debugging messages, to be in-line with our -debug to stdout philosophy
---
 wmbiff/socket.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/wmbiff/socket.c b/wmbiff/socket.c
index 4e353ba..c70a603 100644
--- a/wmbiff/socket.c
+++ b/wmbiff/socket.c
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.3 2001/10/04 09:50:59 jordi Exp $ */
+/* $Id: socket.c,v 1.4 2002/04/12 05:54:36 bluehal Exp $ */
 /* Copyright (C) 1998 Trent Piepho  <xyzzy at u.washington.edu>
  *           (C) 1999 Trent Piepho  <xyzzy at speakeasy.org>
  *
@@ -21,6 +21,9 @@
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <string.h>
 #include <netdb.h>
 #include <stdio.h>
 
@@ -28,6 +31,10 @@
 #include <dmalloc.h>
 #endif
 
+/* nspring/blueHal, 10 Apr 2002; added some extra error
+   printing, in line with the debug-messages-to-stdout
+   philosophy of the rest of the wmbiff code */
+
 int sock_connect(const char *hostname, int port)
 {
 	struct hostent *host;
@@ -37,12 +44,14 @@ int sock_connect(const char *hostname, int port)
 	host = gethostbyname(hostname);
 	if (host == NULL) {
 		herror("gethostbyname");
+		printf("gethostbyname(%s) failed.\n", hostname);
 		return (-1);
 	};
 
 	fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 	if (fd == -1) {
 		perror("Error opening socket");
+		printf("socket() failed.\n");
 		return (-1);
 	};
 
@@ -52,6 +61,8 @@ int sock_connect(const char *hostname, int port)
 	i = connect(fd, (struct sockaddr *) &addr, sizeof(struct sockaddr));
 	if (i == -1) {
 		perror("Error connecting");
+		printf("connect(%s:%d) failed: %s\n", inet_ntoa(addr.sin_addr),
+			   port, strerror(errno));
 		close(fd);
 		return (-1);
 	};

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list