Skip to content

Commit 9544ff5

Browse files
committed
dns: document standalone TESTING mode and add usage
1 parent 9293758 commit 9544ff5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dns.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,22 @@ dns_get_mx_list(const char *host, int port, struct mx_hostentry **he, int no_mx)
273273
return (err);
274274
}
275275

276+
/*
277+
* Standalone test implemenation
278+
* cc -DCONF_PATH=xxx -DLIBEXEC_PATH=xxx -DTESTING -g -o dns dns.c
279+
*/
276280
#if defined(TESTING)
277281
int
278282
main(int argc, char **argv)
279283
{
280284
struct mx_hostentry *he, *p;
281285
int err;
282286

287+
if (argc != 2) {
288+
fprintf(stderr, "usage: %s name\n", argv[0]);
289+
exit(1);
290+
}
291+
283292
err = dns_get_mx_list(argv[1], 53, &he, 0);
284293
if (err)
285294
return (err);

0 commit comments

Comments
 (0)