while (1) -> for (;;), style
This commit is contained in:
+12
-12
@@ -14,7 +14,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: gsstest.c,v 1.6 2007/06/19 23:47:00 tbox Exp $ */
|
||||
/* $Id: gsstest.c,v 1.6.332.1 2011/03/28 05:16:59 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -101,23 +101,23 @@ console(isc_task_t *task, isc_event_t *event)
|
||||
|
||||
isc_event_free(&event);
|
||||
|
||||
while(1) {
|
||||
for (;;) {
|
||||
printf("\nCommand => ");
|
||||
scanf("%s", buf);
|
||||
|
||||
if(strcmp(buf, "quit") == 0) {
|
||||
if (strcmp(buf, "quit") == 0) {
|
||||
isc_app_shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
if(strcmp(buf, "initctx") == 0) {
|
||||
if (strcmp(buf, "initctx") == 0) {
|
||||
ev = isc_event_allocate(mctx, (void *)1, 1, initctx1,
|
||||
NULL, sizeof(*event));
|
||||
isc_task_send(task, &ev);
|
||||
return;
|
||||
}
|
||||
|
||||
if(strcmp(buf, "query") == 0) {
|
||||
if (strcmp(buf, "query") == 0) {
|
||||
ev = isc_event_allocate(mctx, (void *)1, 1, sendquery,
|
||||
NULL, sizeof(*event));
|
||||
isc_task_send(task, &ev);
|
||||
@@ -314,7 +314,7 @@ initctx2(isc_task_t *task, isc_event_t *event) {
|
||||
rdataset = ISC_LIST_HEAD(question_name->list);
|
||||
INSIST(rdataset != NULL);
|
||||
qtype = rdataset->type;
|
||||
if(qtype == dns_rdatatype_tkey) {
|
||||
if (qtype == dns_rdatatype_tkey) {
|
||||
printf("Received TKEY response from server\n");
|
||||
printf("Context completed\n");
|
||||
} else {
|
||||
@@ -324,14 +324,14 @@ initctx2(isc_task_t *task, isc_event_t *event) {
|
||||
tsigkey = NULL;
|
||||
}
|
||||
|
||||
if(response)
|
||||
if (response)
|
||||
dns_message_destroy(&response);
|
||||
|
||||
end:
|
||||
if(query)
|
||||
if (query)
|
||||
dns_message_destroy(&query);
|
||||
|
||||
if(reqev->request)
|
||||
if (reqev->request)
|
||||
dns_request_destroy(&reqev->request);
|
||||
|
||||
isc_event_free(&event);
|
||||
@@ -410,11 +410,11 @@ setup(void)
|
||||
struct in_addr inaddr;
|
||||
int c;
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
printf("Server IP => ");
|
||||
c = scanf("%s", serveraddress);
|
||||
|
||||
if(c == EOF || strcmp(serveraddress, "quit") == 0) {
|
||||
if (c == EOF || strcmp(serveraddress, "quit") == 0) {
|
||||
isc_app_shutdown();
|
||||
return;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ setup(void)
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user