|
|
|
@ -1469,9 +1469,13 @@ void adddns()
|
|
|
|
|
|
|
|
|
|
void addpeerdns() {
|
|
|
|
|
int fd, fd2;
|
|
|
|
|
TQString p = "/var/run/ppp/resolv.conf";
|
|
|
|
|
|
|
|
|
|
if (!TQFile::exists(p))
|
|
|
|
|
p = "/etc/ppp/resolv.conf";
|
|
|
|
|
|
|
|
|
|
if((fd = Requester::rq->openResolv(O_WRONLY|O_APPEND)) >= 0) {
|
|
|
|
|
if((fd2 = open("/etc/ppp/resolv.conf", O_RDONLY)) >= 0) {
|
|
|
|
|
if((fd2 = open(p.latin1(), O_RDONLY)) >= 0) {
|
|
|
|
|
char c;
|
|
|
|
|
int i = 0;
|
|
|
|
|
while(i++ < 100 && read(fd2, &c, 1) == 1) {
|
|
|
|
@ -1482,7 +1486,7 @@ void addpeerdns() {
|
|
|
|
|
}
|
|
|
|
|
close(fd2);
|
|
|
|
|
} else
|
|
|
|
|
fprintf(stderr, "failed to read from /etc/ppp/resolv.conf\n");
|
|
|
|
|
fprintf(stderr, "failed to read from %s\n", p.latin1());
|
|
|
|
|
close(fd);
|
|
|
|
|
}
|
|
|
|
|
add_domain(gpppdata.domain());
|
|
|
|
|