commit - 1cbd57169f4ba279ab21cc2ad55c5f53f03f68b1
commit + 250990a7df3159a84b488bb2a6ba6b5f888f2618
blob - a71c63da063644a19fa0b53b3485807c6d165773
blob + 9785ff4b77d9a64822eae1267d98d0cd9ba083ef
--- unreliablefs/unreliablefs_errinj.c
+++ unreliablefs/unreliablefs_errinj.c
break;
case ERRINJ_SLOWDOWN: ;
struct timespec ts = {};
- ts.tv_nsec = err->duration;
- fprintf(stdout, "start of '%s' slowdown for '%d' ns\n", op_name, err->duration);
+ ts.tv_sec = err->duration / 1000000000;
+ ts.tv_nsec = err->duration % 1000000000;
+ fprintf(stdout, "start of '%s' slowdown for '%llu' ns\n", op_name, err->duration);
if (nanosleep(&ts, NULL) != 0) {
perror("nanosleep");
} else {
- fprintf(stdout, "end of '%s' slowdown with '%d' ns\n", op_name, err->duration);
+ fprintf(stdout, "end of '%s' slowdown with '%llu' ns\n", op_name, err->duration);
}
break;
}
} else if (strcmp(key, "probability") == 0) {
err->probability = atoi(value);
} else if (strcmp(key, "duration") == 0) {
- err->duration = atoi(value);
+ err->duration = atoll(value);
} else {
fprintf(stderr, "unknown option '%s' in configuration file\n", key);
return 0;
blob - 2dcc775ca5c9a010de8149d51d0bc8a92deee037
blob + 0197c155f5bfe601935ad57cdd4d78bb67deb23d
--- unreliablefs/unreliablefs_errinj.h
+++ unreliablefs/unreliablefs_errinj.h
char *path_regexp;
char *errno_regexp;
unsigned int probability;
- unsigned int duration;
+ unsigned long long duration;
errinj_type type;
TAILQ_ENTRY(errinj_conf) entries;