Lines Matching defs:fh
15 /* ssize_t tls_prng_file_read(fh, length)
16 /* TLS_PRNG_SRC *fh;
19 /* int tls_prng_file_close(fh)
20 /* TLS_PRNG_SRC *fh;
88 TLS_PRNG_SRC *fh;
96 fh = (TLS_PRNG_SRC *) mymalloc(sizeof(*fh));
97 fh->fd = fd;
98 fh->name = mystrdup(name);
99 fh->timeout = timeout;
102 return (fh);
108 ssize_t tls_prng_file_read(TLS_PRNG_SRC *fh, size_t len)
116 msg_info("%s: seed internal pool from file %s", myname, fh->name);
118 if (lseek(fh->fd, 0, SEEK_SET) < 0) {
120 msg_info("cannot seek entropy file %s: %m", fh->name);
125 if ((count = timed_read(fh->fd, buffer, to_read > sizeof(buffer) ?
127 fh->timeout, (void *) 0)) < 0) {
129 msg_info("cannot read entropy file %s: %m", fh->name);
138 (long) (len - to_read), fh->name);
144 int tls_prng_file_close(TLS_PRNG_SRC *fh)
150 msg_info("%s: close entropy file %s", myname, fh->name);
151 err = close(fh->fd);
152 myfree(fh->name);
153 myfree((void *) fh);