X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=verify-state.h;h=901aa0a47bcec6d016485e4c6b518c8fa65171d0;hb=d730bc584efd96359ecc838ee7316a2127100b68;hp=f1dc069ec68f4c928f5aca9a0dad9d9c3519cc4e;hpb=94a6e1bb4e7d8e7fee66374841634b0f871c6d6d;p=fio.git diff --git a/verify-state.h b/verify-state.h index f1dc069e..901aa0a4 100644 --- a/verify-state.h +++ b/verify-state.h @@ -2,6 +2,7 @@ #define FIO_VERIFY_STATE_H #include +#include struct thread_rand32_state { uint32_t s[4]; @@ -82,7 +83,24 @@ 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'; }