check syscall return values in a few questions; thanks go to Ian Darwin's
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 7 May 1985 11:06:04 +0000 (03:06 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 7 May 1985 11:06:04 +0000 (03:06 -0800)
rudely public ragging on this one.

SCCS-vsn: usr.sbin/sendmail/src/conf.c 4.9
SCCS-vsn: usr.sbin/sendmail/src/version.c 4.52

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/version.c

index 855ee2f..3bac230 100644 (file)
@@ -34,7 +34,7 @@
 
 
 
 
 
 
-SCCSID(@(#)conf.c      4.8             %G%);
+SCCSID(@(#)conf.c      4.9             %G%);
 \f/*
 **  Header info table
 **     Final (null) entry contains the flags used for any other field.
 \f/*
 **  Header info table
 **     Final (null) entry contains the flags used for any other field.
@@ -525,8 +525,12 @@ getla()
                if (Nl[0].n_type == 0)
                        return (-1);
        }
                if (Nl[0].n_type == 0)
                        return (-1);
        }
-       (void) lseek(kmem, (long) Nl[X_AVENRUN].n_value, 0);
-       (void) read(kmem, avenrun, sizeof(avenrun));
+       if (lseek(kmem, (long) Nl[X_AVENRUN].n_value, 0) < 0 ||
+           read(kmem, avenrun, sizeof(avenrun)) < sizeof(avenrun))
+       {
+               /* thank you Ian */
+               return (-1);
+       }
        return ((int) (avenrun[0] + 0.5));
 }
 
        return ((int) (avenrun[0] + 0.5));
 }
 
index 0a4a8dd..32172f7 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 4.51 of %G%";
+static char    SccsId[] = "@(#)SendMail version 4.52 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "4.51";
+char   Version[] = "4.52";