X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fsonar-icmp.c;h=e74e45d1dc34f70094f38f8c389794233bac1fc9;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hp=8957c1924ea15b2f52756f2d90623107f5debcf9;hpb=f0261d8acab611f3433160e4f07367b870439739;p=xscreensaver diff --git a/hacks/glx/sonar-icmp.c b/hacks/glx/sonar-icmp.c index 8957c192..e74e45d1 100644 --- a/hacks/glx/sonar-icmp.c +++ b/hacks/glx/sonar-icmp.c @@ -60,7 +60,7 @@ #ifndef HAVE_PING sonar_sensor_data * -init_ping (Display *dpy, const char *subnet, int timeout, +init_ping (Display *dpy, char **error_ret, const char *subnet, int timeout, Bool resolve_p, Bool times_p, Bool debug_p) { if (! (!subnet || !*subnet || !strcmp(subnet, "default"))) @@ -366,7 +366,6 @@ read_hosts_file (sonar_sensor_data *ssd, const char *filename) /* Get the name and address */ - name = addr = 0; if ((addr = strtok(buf, " ,;\t\n"))) name = strtok(0, " ,;\t\n"); else @@ -614,7 +613,6 @@ send_ping (ping_data *pd, const sonar_bogie *b) ping_bogie *pb = (ping_bogie *) b->closure; u_char *packet; struct ICMP *icmph; - int result; const char *token = "org.jwz.xscreensaver.sonar"; int pcktsiz = (sizeof(struct ICMP) + sizeof(struct timeval) + @@ -653,8 +651,8 @@ send_ping (ping_data *pd, const sonar_bogie *b) /* Send it */ - if ((result = sendto(pd->icmpsock, packet, pcktsiz, 0, - &pb->address, sizeof(pb->address))) + if (sendto(pd->icmpsock, packet, pcktsiz, 0, + &pb->address, sizeof(pb->address)) != pcktsiz) { #if 0 @@ -1056,7 +1054,7 @@ parse_mode (sonar_sensor_data *ssd, char **error_ret, if (new) { sonar_bogie *nn = new; - while (nn && nn->next) + while (nn->next) nn = nn->next; nn->next = hostlist; hostlist = new;