diff --git a/iscsi-scst/usr/target.c b/iscsi-scst/usr/target.c index b8c8c73dc..bcff10089 100644 --- a/iscsi-scst/usr/target.c +++ b/iscsi-scst/usr/target.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "iscsid.h" @@ -376,7 +377,7 @@ int target_del(u32 tid, u32 cookie) /* We have not yet received session(s) removal event(s), so keep waiting */ log_debug(1, "Target %d has sessions, keep waiting", tid); - usleep(50000); + nanosleep(&(const struct timespec){ .tv_nsec = 50000000 }, NULL); } /* diff --git a/usr/stpgd/stpgd_main.c b/usr/stpgd/stpgd_main.c index b8f09ecb7..2c6916a7a 100644 --- a/usr/stpgd/stpgd_main.c +++ b/usr/stpgd/stpgd_main.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -196,7 +197,7 @@ static int wait_until_finished(pid_t pid, unsigned long deadline, int *status, i } break; } - usleep(100*1000); + nanosleep(&(const struct timespec){ .tv_nsec = 100000000 }, NULL); time(&end); elapsed = difftime(end, start); } while (elapsed < deadline);