On 6/15/18 9:11 AM, Tomohiro Kusumi wrote: > Fixes "fio environment var bug". > https://www.spinics.net/lists/fio/msg07093.html > > Add read_ini_data() to parse and expand env variables within job-file > before sending to server. By doing this, clients can control parameters > embedded within the job-file, without server side having to set them > separately. Looks good to me, just one minor comment: > +static int read_ini_data(int fd, void *data, size_t size) > +{ > + char *p = data; > + int ret = 0; > + > + FILE *fp = fdopen(dup(fd), "r"); > + if (!fp) > + return errno; > + > + while (1) { > + ssize_t len; > + char buf[OPT_LEN_MAX+1], *sub; > + > + if (!fgets(buf, sizeof(buf), fp)) { > + if (ferror(fp)) { > + if (errno == EAGAIN || errno == EINTR) > + continue; > + ret = errno; > + break; > + } else > + break; > + } This should just be: if (!fgets(buf, sizeof(buf), fp)) { if (ferror(fp)) { if (errno == EAGAIN || errno == EINTR) continue; ret = errno; } break; } I'll make that change while applying. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html