- pid_t pid;
- int infd, outfd, rc;
- uschar *argv[5];
-
- DEBUG(D_dns) debug_printf("DNS lookup of %s (%s) using fakens\n",
- name, dns_text_type(type));
-
- argv[0] = utilname;
- argv[1] = spool_directory;
- argv[2] = name;
- argv[3] = dns_text_type(type);
- argv[4] = NULL;
-
- pid = child_open(argv, NULL, 0000, &infd, &outfd, FALSE);
- if (pid < 0)
- log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to run fakens: %s",
- strerror(errno));
-
- len = 0;
- rc = -1;
- while (size > 0 && (rc = read(outfd, answerptr, size)) > 0)
- {
- len += rc;
- answerptr += rc;
- size -= rc;
- }
+ len += rc;
+ aptr += rc; /* Don't modify the actual arguments, because they */
+ asize -= rc; /* may need to be passed on to res_search(). */
+ }