1
0
Files
irix-657m-src/eoe/cmd/efs/lib/efs_cksum.c
2022-09-29 17:59:04 +03:00

23 lines
366 B
C

#ident "$Revision: 1.4 $"
/*
* Compute the checksum of the read in portion of the filesystem
* structure
*/
#include "efs.h"
void
efs_checksum(void)
{
ushort *sp;
long checksum;
checksum = 0;
sp = (ushort *)fs;
while (sp < (ushort *)&fs->fs_checksum) {
checksum ^= *sp++;
checksum = (checksum << 1) | (checksum < 0);
}
fs->fs_checksum = checksum;
}