]> andersk Git - moira.git/blame - update/checksum.c
Don't typecheck service labels
[moira.git] / update / checksum.c
CommitLineData
de56407f 1/*
2 * $Source$
3 * $Header$
4 */
5
6#ifndef lint
7static char *rcsid_checksum_c = "$Header$";
8#endif lint
9
10#include <stdio.h>
11#include <sys/file.h>
12
13/*
14 * checksum_fd(fd)
15 * returns 24-bit checksum of bytes in file
16 */
17
18int
b18a5f6d 19checksum_file(path)
20char *path;
de56407f 21{
de56407f 22 register int sum;
23 register int ch;
24 register FILE *f;
25
de56407f 26 sum = 0;
b18a5f6d 27 f = fopen(path, "r");
de56407f 28 while ((ch = getc(f)) != EOF) {
29 sum = (sum + ch) & ((1<<24)-1);
30 }
31 fclose(f);
32 return(sum);
33}
This page took 0.053626 seconds and 5 git commands to generate.