--- src/sbin/jscan/subs.c 2005/07/06 06:21:05 1.6 +++ src/sbin/jscan/subs.c 2005/09/06 06:42:44 1.7 @@ -354,3 +354,21 @@ dupdatapath(const void *buf, int bytes) return(res); } +void +get_transid_from_file(const char *path, int64_t *transid, int flags) +{ + int n; + int fd; + char buf[32]; + + *transid = 0; + if ((fd = open(path, O_RDONLY)) >= 0) { + n = read(fd, buf, sizeof(buf) - 1); + if (n >= 0) + buf[n] = 0; + *transid = strtoull(buf, NULL, 16); + jmodes |= flags; + close(fd); + } +} +