projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
io_u: cleanup and simplify __get_next_rand_offset_zoned_abs()
[fio.git]
/
verify-state.h
diff --git
a/verify-state.h
b/verify-state.h
index 2fe710f19f9f2f5aeb95c2a9e4d21c25acfd88c3..1586f63fb0f0a61f7eea2a6db90876b24f895960 100644
(file)
--- a/
verify-state.h
+++ b/
verify-state.h
@@
-3,6
+3,7
@@
#include <stdint.h>
#include <string.h>
#include <stdint.h>
#include <string.h>
+#include <limits.h>
struct thread_rand32_state {
uint32_t s[4];
struct thread_rand32_state {
uint32_t s[4];
@@
-76,28
+77,32
@@
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)
{
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)
{
}
static inline void verify_state_gen_name(char *out, size_t size,
const char *name, const char *prefix,
int num)
{
+ char ename[PATH_MAX];
char *ptr;
char *ptr;
- snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
- out[size - 1] = '\0';
-
/*
* Escape '/', just turn them into '.'
*/
/*
* Escape '/', just turn them into '.'
*/
- ptr = out;
- while ((ptr = strchr(ptr, '/')) != NULL) {
- *ptr = '.';
- ptr++;
+ ptr = ename;
+ do {
+ *ptr = *name;
if (*ptr == '\0')
break;
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';
}
#endif
}
#endif