]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdmon.c
mdadm: Replace obsolete usleep with nanosleep
[thirdparty/mdadm.git] / mdmon.c
diff --git a/mdmon.c b/mdmon.c
index c057da6373be3a8a28582e51f8a3be4ec8e1e108..e9d035ebb5bb1095eefc9f5174fbf69eb5df7979 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -99,7 +99,7 @@ static int clone_monitor(struct supertype *container)
        if (rc)
                return rc;
        while (mon_tid == -1)
-               usleep(10);
+               sleep_for(0, USEC_TO_NSEC(10), true);
        pthread_attr_destroy(&attr);
 
        mgr_tid = syscall(SYS_gettid);
@@ -209,7 +209,7 @@ static void try_kill_monitor(pid_t pid, char *devname, int sock)
                rv = kill(pid, SIGUSR1);
                if (rv < 0)
                        break;
-               usleep(200000);
+               sleep_for(0, MSEC_TO_NSEC(200), true);
        }
 }