[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssh-unix-dev
Subject:    [PATCH] Janitor duties
From:       Johan Gill <johane () lysator ! liu ! se>
Date:       2005-12-01 13:19:05
Message-ID: 438EF849.6080207 () lysator ! liu ! se
[Download RAW message or body]

This patch removes a lot of #include from files in openbsd-compat/ since 
"includes.h" is included prior to the others and therefore includes the 
headers first.

Is it OK, or is it a design decision to have the includes specific to 
the c-files in the c-files as well?

There is also the correction of an error. In 
openbsd-compat/readpassphrase.c there was

#ifndef HAVE_READPASSPHRASE

#include <termios.h>
#include <readpassphrase.h>

I changed <readpassphrase.h> to "readpassphrase.h".

Cheers
Johan Gill

["openbsd-compat.diff" (text/plain)]

Index: openbsd-compat/base64.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/base64.c,v
retrieving revision 1.7
diff -u -r1.7 base64.c
--- openbsd-compat/base64.c	10 Nov 2005 08:29:13 -0000	1.7
+++ openbsd-compat/base64.c	1 Dec 2005 13:10:40 -0000
@@ -48,18 +48,6 @@
 
 #if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || \
(!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON))  
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <ctype.h>
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <string.h>
-
 #include "base64.h"
 
 /* XXX abort illegal in library */
Index: openbsd-compat/bsd-closefrom.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/bsd-closefrom.c,v
retrieving revision 1.2
diff -u -r1.2 bsd-closefrom.c
--- openbsd-compat/bsd-closefrom.c	10 Nov 2005 08:29:13 -0000	1.2
+++ openbsd-compat/bsd-closefrom.c	1 Dec 2005 13:10:40 -0000
@@ -18,15 +18,7 @@
 
 #ifndef HAVE_CLOSEFROM
 
-#include <sys/types.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <stddef.h>
 #ifdef HAVE_DIRENT_H
-# include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 #else
 # define dirent direct
Index: openbsd-compat/dirname.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/dirname.c,v
retrieving revision 1.8
diff -u -r1.8 dirname.c
--- openbsd-compat/dirname.c	10 Nov 2005 06:33:00 -0000	1.8
+++ openbsd-compat/dirname.c	1 Dec 2005 13:10:44 -0000
@@ -21,10 +21,6 @@
 #include "includes.h"
 #ifndef HAVE_DIRNAME
 
-#include <errno.h>
-#include <string.h>
-#include <sys/param.h>
-
 char *
 dirname(const char *path)
 {
Index: openbsd-compat/getcwd.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/getcwd.c,v
retrieving revision 1.10
diff -u -r1.10 getcwd.c
--- openbsd-compat/getcwd.c	10 Nov 2005 06:15:07 -0000	1.10
+++ openbsd-compat/getcwd.c	1 Dec 2005 13:10:45 -0000
@@ -34,15 +34,7 @@
 
 #if !defined(HAVE_GETCWD)
 
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <dirent.h>
 #include <sys/dir.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "includes.h"
 
 #define	ISDOT(dp) \
 	(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
Index: openbsd-compat/inet_aton.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/inet_aton.c,v
retrieving revision 1.9
diff -u -r1.9 inet_aton.c
--- openbsd-compat/inet_aton.c	10 Nov 2005 06:21:21 -0000	1.9
+++ openbsd-compat/inet_aton.c	1 Dec 2005 13:10:47 -0000
@@ -55,12 +55,6 @@
 
 #if !defined(HAVE_INET_ATON)
 
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
 #if 0
 /*
  * Ascii internet address interpretation routine.
Index: openbsd-compat/inet_ntoa.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/inet_ntoa.c,v
retrieving revision 1.11
diff -u -r1.11 inet_ntoa.c
--- openbsd-compat/inet_ntoa.c	10 Nov 2005 06:23:55 -0000	1.11
+++ openbsd-compat/inet_ntoa.c	1 Dec 2005 13:10:47 -0000
@@ -38,10 +38,6 @@
  * Convert network-format internet address
  * to base 256 d.d.d.d representation.
  */
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdio.h>
 
 char *
 inet_ntoa(struct in_addr in)
Index: openbsd-compat/inet_ntop.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/inet_ntop.c,v
retrieving revision 1.12
diff -u -r1.12 inet_ntop.c
--- openbsd-compat/inet_ntop.c	10 Nov 2005 06:25:26 -0000	1.12
+++ openbsd-compat/inet_ntop.c	1 Dec 2005 13:10:48 -0000
@@ -22,15 +22,7 @@
 
 #ifndef HAVE_INET_NTOP
 
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
 
 #ifndef IN6ADDRSZ
 #define IN6ADDRSZ   16   /* IPv6 T_AAAA */                 
Index: openbsd-compat/readpassphrase.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/readpassphrase.c,v
retrieving revision 1.16
diff -u -r1.16 readpassphrase.c
--- openbsd-compat/readpassphrase.c	10 Nov 2005 05:56:28 -0000	1.16
+++ openbsd-compat/readpassphrase.c	1 Dec 2005 13:10:49 -0000
@@ -26,8 +26,7 @@
 
 #ifndef HAVE_READPASSPHRASE
 
-#include <termios.h>
-#include <readpassphrase.h>
+#include "readpassphrase.h"
 
 #ifdef TCSASOFT
 # define _T_FLUSH	(TCSAFLUSH|TCSASOFT)
Index: openbsd-compat/realpath.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/realpath.c,v
retrieving revision 1.14
diff -u -r1.14 realpath.c
--- openbsd-compat/realpath.c	12 Nov 2005 03:14:53 -0000	1.14
+++ openbsd-compat/realpath.c	1 Dec 2005 13:10:50 -0000
@@ -33,14 +33,6 @@
 
 #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
 
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
 /*
  * char *realpath(const char *path, char resolved[PATH_MAX]);
  *



_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://www.mindrot.org/mailman/listinfo/openssh-unix-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic