]> andersk Git - moira.git/commitdiff
open & close the file rather than rewinding it.
authormar <mar>
Thu, 4 Aug 1988 14:20:23 +0000 (14:20 +0000)
committermar <mar>
Thu, 4 Aug 1988 14:20:23 +0000 (14:20 +0000)
update/checksum.c

index c2336aafcbfbb258ada9b9e7aec34846de7cc255..86c1d74758a9f8fb0ddc23d0977c93854e474ad9 100644 (file)
@@ -16,18 +16,15 @@ static char *rcsid_checksum_c = "$Header$";
  */
 
 int
-checksum_fd(fd1)
-    int fd1;
+checksum_file(path)
+char *path;
 {
-    int fd;
     register int sum;
     register int ch;
     register FILE *f;
 
-    fd = dup(fd1);
     sum = 0;
-    (void) lseek(fd, 0, L_SET);
-    f = fdopen(fd, "r");
+    f = fopen(path, "r");
     while ((ch = getc(f)) != EOF) {
        sum = (sum + ch) & ((1<<24)-1);
     }
This page took 0.169156 seconds and 5 git commands to generate.