]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/resolve.c
fix ngt_TrimStr(), fix format string
[ngircd-alex.git] / src / ngircd / resolve.c
index e25849497f06869065b02082bc294689b2a808c0..e46e4823b31792a83f198a540e6ef15e065888b0 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: resolve.c,v 1.21 2005/09/12 19:10:20 fw Exp $";
+static char UNUSED id[] = "$Id: resolve.c,v 1.23 2006/02/08 15:24:10 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -83,7 +83,6 @@ Resolve_Addr( RES_STAT *s, struct sockaddr_in *Addr, int identsock, void (*cbfun
        /* Resolve IP (asynchronous!). */
        int pid, pipefd[2];
        assert(s != NULL);
-       s->success = false;
 
        pid = Resolver_fork(pipefd);
        if (pid > 0) {
@@ -109,7 +108,6 @@ Resolve_Name( RES_STAT *s, const char *Host, void (*cbfunc)(int, short))
        /* Resolve hostname (asynchronous!). */
        int pid, pipefd[2];
        assert(s != NULL);
-       s->success = false;
 
        pid = Resolver_fork(pipefd);
        if (pid > 0) {
@@ -136,7 +134,6 @@ Resolve_Init(RES_STAT *s)
        assert(s != NULL);
        s->resolver_fd = -1;
        s->pid = 0;
-       /* s->success must not be changed -- it will be set by other Resolve_*() functions */
 }
 
 
@@ -262,8 +259,7 @@ Do_ResolveName( const char *Host, int w_fd )
 #endif
        /* Write result into pipe to parent */
        len = strlen( ip );
-       ip[len] = '\n'; len++;
-       if( (size_t)write( w_fd, ip, len ) != (size_t)len ) {
+       if( write( w_fd, ip, len ) != len) {
                Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
                close( w_fd );
        }
@@ -357,7 +353,6 @@ Resolve_Read( RES_STAT *s, void* readbuf, size_t buflen)
                return 0;
        }
 
-       s->success = true;
        return bytes_read;
 }
 /* -eof- */