*/
#include "dbench.h"
+#include <zlib.h>
#define ival(s) strtol(s, NULL, 0)
char **sparams, **params;
char *p;
const char *status;
- FILE *f;
+ gzFile *gzf;
pid_t parent = getppid();
double targett;
struct child_struct *child;
- f = fopen(loadfile, "r");
- if (f == NULL) {
+ gzf = gzopen(loadfile, "r");
+ if (gzf == NULL) {
perror(loadfile);
exit(1);
}
nb_time_reset(child);
}
- while (fgets(line, sizeof(line)-1, f)) {
+ while (gzgets(gzf, line, sizeof(line)-1)) {
params = sparams;
if (kill(parent, 0) == -1) {
goto done;
}
- rewind(f);
+ gzrewind(gzf);
goto again;
done:
- fclose(f);
+ gzclose(gzf);
for (child=child0;child<child0+options.clients_per_process;child++) {
child->cleanup = 1;
fflush(stdout);