was crazy before
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Fri, 6 May 1983 07:26:41 +0000 (23:26 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Fri, 6 May 1983 07:26:41 +0000 (23:26 -0800)
SCCS-vsn: old/implogd/implogd.c 4.6

usr/src/old/implogd/implogd.c

index dce5bec..08c8f6a 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)implogd.c  4.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)implogd.c  4.6 (Berkeley) %G%";
 #endif
 
 #include <time.h>
 #endif
 
 #include <time.h>
@@ -71,13 +71,15 @@ main(argc, argv)
                sleep(5);
        }
        for (;;) {
                sleep(5);
        }
        for (;;) {
-               int len = sizeof (request);
+               int fromlen = sizeof (from), len;
 
 
-               if (recvfrom(s, request, &len, 0, &from, sizeof (from)) < 0) {
+               len = recvfrom(s, request, sizeof (request), 0,
+                       &from, &fromlen);
+               if (len < 0) {
                        perror("implogd: recvfrom");
                        continue;
                }
                        perror("implogd: recvfrom");
                        continue;
                }
-               if (len <= 0 || len > IMPMTU)   /* sanity */
+               if (len == 0 || len > IMPMTU)   /* sanity */
                        continue;
                from.sin_len = len;
                from.sin_time = time(0);
                        continue;
                from.sin_len = len;
                from.sin_time = time(0);