X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=verify-state.h;h=1586f63fb0f0a61f7eea2a6db90876b24f895960;hp=f1dc069ec68f4c928f5aca9a0dad9d9c3519cc4e;hb=f5c3bcf2fd64d2e3e0869346a34e6627f177076f;hpb=3bf80dad77448afcb18148e72dc6cfe04bcf7e57 diff --git a/verify-state.h b/verify-state.h index f1dc069e..1586f63f 100644 --- a/verify-state.h +++ b/verify-state.h @@ -2,6 +2,8 @@ #define FIO_VERIFY_STATE_H #include +#include +#include struct thread_rand32_state { uint32_t s[4]; @@ -75,14 +77,31 @@ static inline size_t thread_io_list_sz(struct thread_io_list *s) static inline struct thread_io_list *io_list_next(struct thread_io_list *s) { - return (void *) s + thread_io_list_sz(s); + return (struct thread_io_list *)((char *) s + thread_io_list_sz(s)); } static inline void verify_state_gen_name(char *out, size_t size, const char *name, const char *prefix, int num) { - snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num); + char ename[PATH_MAX]; + char *ptr; + + /* + * Escape '/', just turn them into '.' + */ + ptr = ename; + do { + *ptr = *name; + if (*ptr == '\0') + break; + else if (*ptr == '/') + *ptr = '.'; + ptr++; + name++; + } while (1); + + snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num); out[size - 1] = '\0'; }