summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2010-08-05 21:09:54 -0700
committerDan Nicolaescu <dann@ics.uci.edu>2010-08-05 21:09:54 -0700
commit8f54a20c71c3821a42c9144f9db5a15265648470 (patch)
tree1357f89da61638b4a6daf2b1e41ca1a4a76fa002 /lib-src/emacsclient.c
parentaa34405c0994d491dab5f0584c0ff93dd9fa0e0e (diff)
downloademacs-8f54a20c71c3821a42c9144f9db5a15265648470.tar.gz
emacsclient.c cleanups.
* lib-src/emacsclient.c: Move socket related #includes together with the rest of the #includes. Move a WINDOWSNT includes closer together. (HAVE_CONFIG_H): Remove. (NO_RETURN): Remove, defined in config.h. (main): Convert definition to standard C.
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r--lib-src/emacsclient.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 1ca9b793f3a..cbc1dfe3f6a 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -18,9 +18,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#ifdef WINDOWSNT
@@ -32,6 +30,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# include <stdlib.h>
# include <windows.h>
# include <commctrl.h>
+# include <io.h>
+# include <winsock2.h>
# define NO_SOCKETS_IN_FILE_SYSTEM
@@ -45,8 +45,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# ifdef HAVE_INET_SOCKETS
# include <netinet/in.h>
+# ifdef HAVE_SOCKETS
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <sys/un.h>
+# endif /* HAVE_SOCKETS */
# endif
-
# include <arpa/inet.h>
# define INVALID_SOCKET -1
@@ -67,19 +71,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include "getopt.h"
#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
#endif
-#ifdef WINDOWSNT
-# include <io.h>
-#else /* not WINDOWSNT */
-# include <pwd.h>
-#endif /* not WINDOWSNT */
+#include <pwd.h>
#include <sys/stat.h>
-
#include <signal.h>
#include <errno.h>
+
char *getenv (const char *), *getwd (char *);
#ifdef HAVE_GETCWD
@@ -114,10 +114,6 @@ char *w32_getenv (char *);
#define TRUE 1
#endif
-#ifndef NO_RETURN
-#define NO_RETURN
-#endif
-
/* Additional space when allocating buffers for filenames, etc. */
#define EXTRA_SPACE 100
@@ -702,9 +698,7 @@ fail (void)
#if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS)
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
main_argv = argv;
progname = argv[0];
@@ -716,14 +710,6 @@ main (argc, argv)
#else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
-#ifdef WINDOWSNT
-# include <winsock2.h>
-#else
-# include <sys/types.h>
-# include <sys/socket.h>
-# include <sys/un.h>
-#endif
-
#define AUTH_KEY_LENGTH 64
#define SEND_BUFFER_SIZE 4096