#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>
/* Resolve IP (asynchronous!). */
int pid, pipefd[2];
assert(s != NULL);
- s->success = false;
pid = Resolver_fork(pipefd);
if (pid > 0) {
/* Resolve hostname (asynchronous!). */
int pid, pipefd[2];
assert(s != NULL);
- s->success = false;
pid = Resolver_fork(pipefd);
if (pid > 0) {
assert(s != NULL);
s->resolver_fd = -1;
s->pid = 0;
- /* s->success must not be changed -- it will be set by other Resolve_*() functions */
}
#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 );
}
return 0;
}
- s->success = true;
return bytes_read;
}
/* -eof- */