Re: time(1): kill some lint-era voids, switch to getprogname(3)

2017-07-22 Thread Ingo Schwarze
Hi Scott,

Scott Cheloha wrote on Thu, Jul 13, 2017 at 07:37:46PM -0500:

> The (void) casts are going out of style.  While here,
> switch from __progname to getprogname(3)

Committed.
  Ingo


> Index: usr.bin/time/time.c
> ===
> RCS file: /cvs/src/usr.bin/time/time.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 time.c
> --- usr.bin/time/time.c   13 Jul 2017 06:39:54 -  1.22
> +++ usr.bin/time/time.c   14 Jul 2017 00:34:33 -
> @@ -93,8 +93,8 @@ main(int argc, char *argv[])
>   }
>  
>   /* parent */
> - (void)signal(SIGINT, SIG_IGN);
> - (void)signal(SIGQUIT, SIG_IGN);
> + signal(SIGINT, SIG_IGN);
> + signal(SIGQUIT, SIG_IGN);
>   while (wait3(, 0, ) != pid)
>   ;
>   clock_gettime(CLOCK_MONOTONIC, );
> @@ -180,9 +180,7 @@ main(int argc, char *argv[])
>  __dead void
>  usage(void)
>  {
> - extern char *__progname;
> -
> - (void)fprintf(stderr, "usage: %s [-lp] utility [argument ...]\n",
> - __progname);
> + fprintf(stderr, "usage: %s [-lp] utility [argument ...]\n",
> + getprogname());
>   exit(1);
>  }



time(1): kill some lint-era voids, switch to getprogname(3)

2017-07-13 Thread Scott Cheloha
The (void) casts are going out of style.  While here,
switch from __progname to getprogname(3)

--
Scott Cheloha

Index: usr.bin/time/time.c
===
RCS file: /cvs/src/usr.bin/time/time.c,v
retrieving revision 1.22
diff -u -p -r1.22 time.c
--- usr.bin/time/time.c 13 Jul 2017 06:39:54 -  1.22
+++ usr.bin/time/time.c 14 Jul 2017 00:34:33 -
@@ -93,8 +93,8 @@ main(int argc, char *argv[])
}
 
/* parent */
-   (void)signal(SIGINT, SIG_IGN);
-   (void)signal(SIGQUIT, SIG_IGN);
+   signal(SIGINT, SIG_IGN);
+   signal(SIGQUIT, SIG_IGN);
while (wait3(, 0, ) != pid)
;
clock_gettime(CLOCK_MONOTONIC, );
@@ -180,9 +180,7 @@ main(int argc, char *argv[])
 __dead void
 usage(void)
 {
-   extern char *__progname;
-
-   (void)fprintf(stderr, "usage: %s [-lp] utility [argument ...]\n",
-   __progname);
+   fprintf(stderr, "usage: %s [-lp] utility [argument ...]\n",
+   getprogname());
exit(1);
 }