If the job name includes a front slash, then we get an error when
we try to create the state file name:
fio: open state file: No such file or directory
Change the '/' to '.' instead, so we generate a valid file name.
Signed-off-by: Jens Axboe <axboe@fb.com>
#define FIO_VERIFY_STATE_H
#include <stdint.h>
+#include <string.h>
struct thread_rand32_state {
uint32_t s[4];
const char *name, const char *prefix,
int num)
{
+ char *ptr;
+
snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
out[size - 1] = '\0';
+
+ /*
+ * Escape '/', just turn them into '.'
+ */
+ ptr = out;
+ while ((ptr = strchr(ptr, '/')) != NULL) {
+ *ptr = '.';
+ ptr++;
+ if (*ptr == '\0')
+ break;
+ }
}
#endif