[2019-03-08 23:43] Jan <cl...@rote.ch>
> >From f7b8f943d1f7a8f26df8d81eeb0a2d5a69ee7e22 Mon Sep 17 00:00:00 2001
> From: Jan <cl...@rote.ch>
> Date: Wed, 6 Mar 2019 18:38:04 +0100
> Subject: [PATCH] fix: replace obsolete usleep with nanosleep
>
>  POSIX.1-2001 declares usleep obsolete,
>  POSIX.1-2008 removes the specification of usleep,
>  see https://linux.die.net/man/3/usleep

Looks good to me. Thank you. I will let this patch hang till release,
and will apply and upload after thaw. While change seems perfectly fine,
moving parts around freeze feels worriesome.

Gerrit, as you can see, there is some activity around runit, in
particular about C code. I consider releasing runit-2.1.2 with
all patches, accumulated in Debian package as runit-2.1.3 for
convenience of other distributions (Void, Gentoo). Do you object?
Would you like to do it yourself?

> ---
>  runit-2.1.2/src/sv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/runit-2.1.2/src/sv.c b/runit-2.1.2/src/sv.c
> index 6cc2a8b..f97c5a2 100644
> --- a/runit-2.1.2/src/sv.c
> +++ b/runit-2.1.2/src/sv.c
> @@ -1,5 +1,6 @@
>  #include <sys/types.h>
>  #include <sys/stat.h>
> +#include <time.h>
>  #include <unistd.h>
>  #include "str.h"
>  #include "strerr.h"
> @@ -271,6 +272,7 @@ int control(char *a) {
>  int main(int argc, char **argv) {
>    unsigned int i, done;
>    char *x;
> +  const struct timespec sleeptime = {0, 420000000};
>  
>    progname =*argv;
>    for (i =str_len(*argv); i; --i) if ((*argv)[i -1] == '/') break;
> @@ -388,7 +390,7 @@ int main(int argc, char **argv) {
>            fatal("unable to change to original directory");
>        }
>        if (done) break;
> -      usleep(420000);
> +      nanosleep(&sleeptime, NULL);
>        taia_now(&tnow);
>      }
>    return(rc > 99 ? 99 : rc);
> -- 
> 2.20.1
>
-- 
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply via email to