Re: extern optind etc already declared in unistd.h

2021-11-23 Thread Todd C . Miller
On Mon, 22 Nov 2021 17:53:48 -0700, "Theo de Raadt" wrote:

> > This is the usr.sbin part; I am not touching nsd
> > and other third-party stuff.
>
> Well, some of our programs do have -portable variations (not just openssh),
> and some of them will have to cope.

I don't think we really care about portability to pre-POSIX systems,
do we?

 - todd



Re: extern optind etc already declared in unistd.h

2021-11-22 Thread Theo de Raadt
> This is the usr.sbin part; I am not touching nsd
> and other third-party stuff.

Well, some of our programs do have -portable variations (not just openssh),
and some of them will have to cope.



extern optind etc already declared in unistd.h

2021-11-22 Thread Jan Stary
extern optind and friends are already declared
once unistd.h is included, to these can be removed.

This is the usr.sbin part; I am not touching nsd
and other third-party stuff.

Jan


Index: usr.sbin//yppoll/yppoll.c
===
RCS file: /cvs/src/usr.sbin/yppoll/yppoll.c,v
retrieving revision 1.15
diff -u -p -r1.15 yppoll.c
--- usr.sbin//yppoll/yppoll.c   16 Jan 2015 06:40:22 -  1.15
+++ usr.sbin//yppoll/yppoll.c   22 Nov 2021 23:06:04 -
@@ -126,8 +126,6 @@ int
 main(int argc, char *argv[])
 {
char *domainname, *hostname = NULL, *inmap, *master;
-   extern char *optarg;
-   extern int optind;
int order, c, r;
time_t torder;
 
Index: usr.sbin//ypserv/makedbm/makedbm.c
===
RCS file: /cvs/src/usr.sbin/ypserv/makedbm/makedbm.c,v
retrieving revision 1.33
diff -u -p -r1.33 makedbm.c
--- usr.sbin//ypserv/makedbm/makedbm.c  9 Feb 2015 23:00:15 -   1.33
+++ usr.sbin//ypserv/makedbm/makedbm.c  22 Nov 2021 23:06:04 -
@@ -302,9 +302,6 @@ main(int argc, char *argv[])
char*infile, *outfile;
int ch;
 
-   extern int optind;
-   extern char *optarg;
-
yp_input_file = yp_output_file = NULL;
yp_master_name = yp_domain_name = NULL;
aflag = uflag = bflag = lflag = sflag = Uflag = 0;
Index: usr.sbin//ypserv/yppush/yppush.c
===
RCS file: /cvs/src/usr.sbin/ypserv/yppush/yppush.c,v
retrieving revision 1.31
diff -u -p -r1.31 yppush.c
--- usr.sbin//ypserv/yppush/yppush.c16 Jan 2015 06:40:23 -  1.31
+++ usr.sbin//ypserv/yppush/yppush.c22 Nov 2021 23:06:04 -
@@ -216,8 +216,6 @@ int
 main(int argc, char *argv[])
 {
struct ypall_callback ypcb;
-   extern char *optarg;
-   extern int optind;
char*domain, *map, *hostname;
int c, r, i;
char *ypmap = "ypservers";
Index: usr.sbin//ypset/ypset.c
===
RCS file: /cvs/src/usr.sbin/ypset/ypset.c,v
retrieving revision 1.20
diff -u -p -r1.20 ypset.c
--- usr.sbin//ypset/ypset.c 16 Jan 2015 06:40:23 -  1.20
+++ usr.sbin//ypset/ypset.c 22 Nov 2021 23:06:04 -
@@ -106,8 +106,6 @@ main(int argc, char *argv[])
 {
struct sockaddr_in sin;
struct hostent *hent;
-   extern char *optarg;
-   extern int optind;
char *domainname;
int c;