diff options
| author | Paul Eggert | 2018-11-26 11:36:51 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-11-26 11:39:45 -0800 |
| commit | ed3ae3fc58c12bb413f52026c06320a5fff84084 (patch) | |
| tree | c02551f89f2959e3a9c5f39afc6a15f8f5dba871 /lib-src | |
| parent | 5c1bf59658997eef5bbd7dd10f406d92e3aeb3a5 (diff) | |
| download | emacs-ed3ae3fc58c12bb413f52026c06320a5fff84084.tar.gz emacs-ed3ae3fc58c12bb413f52026c06320a5fff84084.zip | |
emacsclient: assume HAVE_INET_SOCKETS
* configure.ac (HAVE_INET_SOCKETS): Remove.
* lib-src/emacsclient.c: Simplify by assuming HAVE_SOCKETS and
HAVE_INET_SOCKETS, which are always true nowadays, except perhaps
for MS-DOS and if so this program shouldn’t be built there anyway.
Don’t bother including sys/types.h, as it’s not needed on modern
systems (and syswait.h does it for us anyway).
(main): Simplify by assuming SIGSTOP (which is always defined
if SIGCONT is), and by assuming HAVE_SOCKETS && HAVE_INET_SOCKETS.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacsclient.c | 112 |
1 files changed, 48 insertions, 64 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 084de792eb0..e72c5e8cf16 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -44,20 +44,15 @@ char *w32_getenv (const char *); | |||
| 44 | #else /* !WINDOWSNT */ | 44 | #else /* !WINDOWSNT */ |
| 45 | 45 | ||
| 46 | # ifdef HAVE_NTGUI | 46 | # ifdef HAVE_NTGUI |
| 47 | # include <windows.h> | 47 | # include <windows.h> |
| 48 | # endif /* HAVE_NTGUI */ | 48 | # endif |
| 49 | 49 | ||
| 50 | # include "syswait.h" | 50 | # include "syswait.h" |
| 51 | 51 | ||
| 52 | # ifdef HAVE_INET_SOCKETS | ||
| 53 | # include <netinet/in.h> | ||
| 54 | # ifdef HAVE_SOCKETS | ||
| 55 | # include <sys/types.h> | ||
| 56 | # include <sys/socket.h> | ||
| 57 | # include <sys/un.h> | ||
| 58 | # endif /* HAVE_SOCKETS */ | ||
| 59 | # endif | ||
| 60 | # include <arpa/inet.h> | 52 | # include <arpa/inet.h> |
| 53 | # include <netinet/in.h> | ||
| 54 | # include <sys/socket.h> | ||
| 55 | # include <sys/un.h> | ||
| 61 | 56 | ||
| 62 | # define SOCKETS_IN_FILE_SYSTEM | 57 | # define SOCKETS_IN_FILE_SYSTEM |
| 63 | 58 | ||
| @@ -732,21 +727,19 @@ fail (void) | |||
| 732 | } | 727 | } |
| 733 | 728 | ||
| 734 | 729 | ||
| 735 | #if defined HAVE_SOCKETS && defined HAVE_INET_SOCKETS | 730 | #ifdef SOCKETS_IN_FILE_SYSTEM |
| 736 | |||
| 737 | # ifdef SOCKETS_IN_FILE_SYSTEM | ||
| 738 | static void act_on_signals (HSOCKET); | 731 | static void act_on_signals (HSOCKET); |
| 739 | # else | 732 | #else |
| 740 | static void act_on_signals (HSOCKET s) {} | 733 | static void act_on_signals (HSOCKET s) {} |
| 741 | static void init_signals (void) {} | 734 | static void init_signals (void) {} |
| 742 | # endif | 735 | #endif |
| 743 | 736 | ||
| 744 | enum { AUTH_KEY_LENGTH = 64 }; | 737 | enum { AUTH_KEY_LENGTH = 64 }; |
| 745 | 738 | ||
| 746 | static void | 739 | static void |
| 747 | sock_err_message (const char *function_name) | 740 | sock_err_message (const char *function_name) |
| 748 | { | 741 | { |
| 749 | # ifdef WINDOWSNT | 742 | #ifdef WINDOWSNT |
| 750 | /* On Windows, the socket library was historically separate from the | 743 | /* On Windows, the socket library was historically separate from the |
| 751 | standard C library, so errors are handled differently. */ | 744 | standard C library, so errors are handled differently. */ |
| 752 | 745 | ||
| @@ -763,9 +756,9 @@ sock_err_message (const char *function_name) | |||
| 763 | message (true, "%s: %s: %s\n", progname, function_name, msg); | 756 | message (true, "%s: %s: %s\n", progname, function_name, msg); |
| 764 | 757 | ||
| 765 | LocalFree (msg); | 758 | LocalFree (msg); |
| 766 | # else | 759 | #else |
| 767 | message (true, "%s: %s: %s\n", progname, function_name, strerror (errno)); | 760 | message (true, "%s: %s: %s\n", progname, function_name, strerror (errno)); |
| 768 | # endif | 761 | #endif |
| 769 | } | 762 | } |
| 770 | 763 | ||
| 771 | 764 | ||
| @@ -877,7 +870,7 @@ unquote_argument (char *str) | |||
| 877 | } | 870 | } |
| 878 | 871 | ||
| 879 | 872 | ||
| 880 | # ifdef WINDOWSNT | 873 | #ifdef WINDOWSNT |
| 881 | /* Wrapper to make WSACleanup a cdecl, as required by atexit. */ | 874 | /* Wrapper to make WSACleanup a cdecl, as required by atexit. */ |
| 882 | void __cdecl close_winsock (void); | 875 | void __cdecl close_winsock (void); |
| 883 | void __cdecl | 876 | void __cdecl |
| @@ -901,7 +894,7 @@ initialize_sockets (void) | |||
| 901 | 894 | ||
| 902 | atexit (close_winsock); | 895 | atexit (close_winsock); |
| 903 | } | 896 | } |
| 904 | # endif /* WINDOWSNT */ | 897 | #endif /* WINDOWSNT */ |
| 905 | 898 | ||
| 906 | 899 | ||
| 907 | /* If the home directory is HOME, return the configuration file with | 900 | /* If the home directory is HOME, return the configuration file with |
| @@ -940,10 +933,10 @@ get_server_config (const char *config_file, struct sockaddr_in *server, | |||
| 940 | else | 933 | else |
| 941 | { | 934 | { |
| 942 | config = open_config (egetenv ("HOME"), config_file); | 935 | config = open_config (egetenv ("HOME"), config_file); |
| 943 | # ifdef WINDOWSNT | 936 | #ifdef WINDOWSNT |
| 944 | if (!config) | 937 | if (!config) |
| 945 | config = open_config (egetenv ("APPDATA"), config_file); | 938 | config = open_config (egetenv ("APPDATA"), config_file); |
| 946 | # endif | 939 | #endif |
| 947 | } | 940 | } |
| 948 | 941 | ||
| 949 | if (! config) | 942 | if (! config) |
| @@ -1079,7 +1072,7 @@ find_tty (const char **tty_type, const char **tty_name, bool noabort) | |||
| 1079 | } | 1072 | } |
| 1080 | 1073 | ||
| 1081 | 1074 | ||
| 1082 | # ifdef SOCKETS_IN_FILE_SYSTEM | 1075 | #ifdef SOCKETS_IN_FILE_SYSTEM |
| 1083 | 1076 | ||
| 1084 | /* Three possibilities: | 1077 | /* Three possibilities: |
| 1085 | >0 - 'stat' failed with this errno value | 1078 | >0 - 'stat' failed with this errno value |
| @@ -1117,10 +1110,10 @@ socket_status (const char *name) | |||
| 1117 | static void | 1110 | static void |
| 1118 | reinstall_handler_if_needed (int sig, void (*handler) (int)) | 1111 | reinstall_handler_if_needed (int sig, void (*handler) (int)) |
| 1119 | { | 1112 | { |
| 1120 | # ifndef SA_RESETHAND | 1113 | # ifndef SA_RESETHAND |
| 1121 | /* This is a platform without POSIX's sigaction. */ | 1114 | /* This is a platform without POSIX's sigaction. */ |
| 1122 | signal (sig, handler); | 1115 | signal (sig, handler); |
| 1123 | # endif | 1116 | # endif |
| 1124 | } | 1117 | } |
| 1125 | 1118 | ||
| 1126 | /* Flags for each signal, and handlers that set the flags. */ | 1119 | /* Flags for each signal, and handlers that set the flags. */ |
| @@ -1160,7 +1153,7 @@ handle_sigwinch (int sig) | |||
| 1160 | static void | 1153 | static void |
| 1161 | install_handler (int sig, void (*handler) (int), sig_atomic_t volatile *flag) | 1154 | install_handler (int sig, void (*handler) (int), sig_atomic_t volatile *flag) |
| 1162 | { | 1155 | { |
| 1163 | # ifdef SA_RESETHAND | 1156 | # ifdef SA_RESETHAND |
| 1164 | if (flag) | 1157 | if (flag) |
| 1165 | { | 1158 | { |
| 1166 | struct sigaction oact; | 1159 | struct sigaction oact; |
| @@ -1170,7 +1163,7 @@ install_handler (int sig, void (*handler) (int), sig_atomic_t volatile *flag) | |||
| 1170 | struct sigaction act = { .sa_handler = handler }; | 1163 | struct sigaction act = { .sa_handler = handler }; |
| 1171 | sigemptyset (&act.sa_mask); | 1164 | sigemptyset (&act.sa_mask); |
| 1172 | sigaction (sig, &act, NULL); | 1165 | sigaction (sig, &act, NULL); |
| 1173 | # else | 1166 | # else |
| 1174 | void (*ohandler) (int) = signal (sig, handler); | 1167 | void (*ohandler) (int) = signal (sig, handler); |
| 1175 | if (flag) | 1168 | if (flag) |
| 1176 | { | 1169 | { |
| @@ -1182,7 +1175,7 @@ install_handler (int sig, void (*handler) (int), sig_atomic_t volatile *flag) | |||
| 1182 | *flag = 0; | 1175 | *flag = 0; |
| 1183 | } | 1176 | } |
| 1184 | } | 1177 | } |
| 1185 | # endif | 1178 | # endif |
| 1186 | } | 1179 | } |
| 1187 | 1180 | ||
| 1188 | /* Initial installation of signal handlers. */ | 1181 | /* Initial installation of signal handlers. */ |
| @@ -1311,10 +1304,10 @@ set_local_socket (const char *local_socket_name) | |||
| 1311 | tmpdir = egetenv ("TMPDIR"); | 1304 | tmpdir = egetenv ("TMPDIR"); |
| 1312 | if (!tmpdir) | 1305 | if (!tmpdir) |
| 1313 | { | 1306 | { |
| 1314 | # ifdef DARWIN_OS | 1307 | # ifdef DARWIN_OS |
| 1315 | # ifndef _CS_DARWIN_USER_TEMP_DIR | 1308 | # ifndef _CS_DARWIN_USER_TEMP_DIR |
| 1316 | # define _CS_DARWIN_USER_TEMP_DIR 65537 | 1309 | # define _CS_DARWIN_USER_TEMP_DIR 65537 |
| 1317 | # endif | 1310 | # endif |
| 1318 | size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, 0); | 1311 | size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, 0); |
| 1319 | if (n > 0) | 1312 | if (n > 0) |
| 1320 | { | 1313 | { |
| @@ -1322,7 +1315,7 @@ set_local_socket (const char *local_socket_name) | |||
| 1322 | confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n); | 1315 | confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir_storage, n); |
| 1323 | } | 1316 | } |
| 1324 | else | 1317 | else |
| 1325 | # endif | 1318 | # endif |
| 1326 | tmpdir = "/tmp"; | 1319 | tmpdir = "/tmp"; |
| 1327 | } | 1320 | } |
| 1328 | socket_name_storage = | 1321 | socket_name_storage = |
| @@ -1417,7 +1410,7 @@ set_local_socket (const char *local_socket_name) | |||
| 1417 | CLOSE_SOCKET (s); | 1410 | CLOSE_SOCKET (s); |
| 1418 | return INVALID_SOCKET; | 1411 | return INVALID_SOCKET; |
| 1419 | } | 1412 | } |
| 1420 | # endif /* SOCKETS_IN_FILE_SYSTEM */ | 1413 | #endif /* SOCKETS_IN_FILE_SYSTEM */ |
| 1421 | 1414 | ||
| 1422 | static HSOCKET | 1415 | static HSOCKET |
| 1423 | set_socket (bool no_exit_if_error) | 1416 | set_socket (bool no_exit_if_error) |
| @@ -1427,7 +1420,7 @@ set_socket (bool no_exit_if_error) | |||
| 1427 | 1420 | ||
| 1428 | INITIALIZE (); | 1421 | INITIALIZE (); |
| 1429 | 1422 | ||
| 1430 | # ifdef SOCKETS_IN_FILE_SYSTEM | 1423 | #ifdef SOCKETS_IN_FILE_SYSTEM |
| 1431 | /* Explicit --socket-name argument. */ | 1424 | /* Explicit --socket-name argument. */ |
| 1432 | if (!socket_name) | 1425 | if (!socket_name) |
| 1433 | socket_name = egetenv ("EMACS_SOCKET_NAME"); | 1426 | socket_name = egetenv ("EMACS_SOCKET_NAME"); |
| @@ -1441,7 +1434,7 @@ set_socket (bool no_exit_if_error) | |||
| 1441 | progname, socket_name); | 1434 | progname, socket_name); |
| 1442 | exit (EXIT_FAILURE); | 1435 | exit (EXIT_FAILURE); |
| 1443 | } | 1436 | } |
| 1444 | # endif | 1437 | #endif |
| 1445 | 1438 | ||
| 1446 | /* Explicit --server-file arg or EMACS_SERVER_FILE variable. */ | 1439 | /* Explicit --server-file arg or EMACS_SERVER_FILE variable. */ |
| 1447 | if (!local_server_file) | 1440 | if (!local_server_file) |
| @@ -1458,12 +1451,12 @@ set_socket (bool no_exit_if_error) | |||
| 1458 | exit (EXIT_FAILURE); | 1451 | exit (EXIT_FAILURE); |
| 1459 | } | 1452 | } |
| 1460 | 1453 | ||
| 1461 | # ifdef SOCKETS_IN_FILE_SYSTEM | 1454 | #ifdef SOCKETS_IN_FILE_SYSTEM |
| 1462 | /* Implicit local socket. */ | 1455 | /* Implicit local socket. */ |
| 1463 | s = set_local_socket ("server"); | 1456 | s = set_local_socket ("server"); |
| 1464 | if (s != INVALID_SOCKET) | 1457 | if (s != INVALID_SOCKET) |
| 1465 | return s; | 1458 | return s; |
| 1466 | # endif | 1459 | #endif |
| 1467 | 1460 | ||
| 1468 | /* Implicit server file. */ | 1461 | /* Implicit server file. */ |
| 1469 | s = set_tcp_socket ("server"); | 1462 | s = set_tcp_socket ("server"); |
| @@ -1472,16 +1465,16 @@ set_socket (bool no_exit_if_error) | |||
| 1472 | 1465 | ||
| 1473 | /* No implicit or explicit socket, and no alternate editor. */ | 1466 | /* No implicit or explicit socket, and no alternate editor. */ |
| 1474 | message (true, "%s: No socket or alternate editor. Please use:\n\n" | 1467 | message (true, "%s: No socket or alternate editor. Please use:\n\n" |
| 1475 | # ifdef SOCKETS_IN_FILE_SYSTEM | 1468 | #ifdef SOCKETS_IN_FILE_SYSTEM |
| 1476 | "\t--socket-name\n" | 1469 | "\t--socket-name\n" |
| 1477 | # endif | 1470 | #endif |
| 1478 | "\t--server-file (or environment variable EMACS_SERVER_FILE)\n\ | 1471 | "\t--server-file (or environment variable EMACS_SERVER_FILE)\n\ |
| 1479 | \t--alternate-editor (or environment variable ALTERNATE_EDITOR)\n", | 1472 | \t--alternate-editor (or environment variable ALTERNATE_EDITOR)\n", |
| 1480 | progname); | 1473 | progname); |
| 1481 | exit (EXIT_FAILURE); | 1474 | exit (EXIT_FAILURE); |
| 1482 | } | 1475 | } |
| 1483 | 1476 | ||
| 1484 | # ifdef HAVE_NTGUI | 1477 | #ifdef HAVE_NTGUI |
| 1485 | FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */ | 1478 | FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */ |
| 1486 | FARPROC get_wc; /* Pointer to RealGetWindowClassA. */ | 1479 | FARPROC get_wc; /* Pointer to RealGetWindowClassA. */ |
| 1487 | 1480 | ||
| @@ -1565,14 +1558,14 @@ w32_give_focus (void) | |||
| 1565 | && (get_wc = GetProcAddress (user32, "RealGetWindowClassA"))) | 1558 | && (get_wc = GetProcAddress (user32, "RealGetWindowClassA"))) |
| 1566 | EnumWindows (w32_find_emacs_process, (LPARAM) 0); | 1559 | EnumWindows (w32_find_emacs_process, (LPARAM) 0); |
| 1567 | } | 1560 | } |
| 1568 | # endif /* HAVE_NTGUI */ | 1561 | #endif /* HAVE_NTGUI */ |
| 1569 | 1562 | ||
| 1570 | /* Start the emacs daemon and try to connect to it. */ | 1563 | /* Start the emacs daemon and try to connect to it. */ |
| 1571 | 1564 | ||
| 1572 | static HSOCKET | 1565 | static HSOCKET |
| 1573 | start_daemon_and_retry_set_socket (void) | 1566 | start_daemon_and_retry_set_socket (void) |
| 1574 | { | 1567 | { |
| 1575 | # ifndef WINDOWSNT | 1568 | #ifndef WINDOWSNT |
| 1576 | pid_t dpid; | 1569 | pid_t dpid; |
| 1577 | int status; | 1570 | int status; |
| 1578 | 1571 | ||
| @@ -1605,7 +1598,7 @@ start_daemon_and_retry_set_socket (void) | |||
| 1605 | d_argv[0] = emacs; | 1598 | d_argv[0] = emacs; |
| 1606 | d_argv[1] = daemon_option; | 1599 | d_argv[1] = daemon_option; |
| 1607 | d_argv[2] = 0; | 1600 | d_argv[2] = 0; |
| 1608 | # ifdef SOCKETS_IN_FILE_SYSTEM | 1601 | # ifdef SOCKETS_IN_FILE_SYSTEM |
| 1609 | if (socket_name != NULL) | 1602 | if (socket_name != NULL) |
| 1610 | { | 1603 | { |
| 1611 | /* Pass --daemon=socket_name as argument. */ | 1604 | /* Pass --daemon=socket_name as argument. */ |
| @@ -1615,12 +1608,12 @@ start_daemon_and_retry_set_socket (void) | |||
| 1615 | strcpy (stpcpy (daemon_arg, deq), socket_name); | 1608 | strcpy (stpcpy (daemon_arg, deq), socket_name); |
| 1616 | d_argv[1] = daemon_arg; | 1609 | d_argv[1] = daemon_arg; |
| 1617 | } | 1610 | } |
| 1618 | # endif | 1611 | # endif |
| 1619 | execvp ("emacs", d_argv); | 1612 | execvp ("emacs", d_argv); |
| 1620 | message (true, "%s: error starting emacs daemon\n", progname); | 1613 | message (true, "%s: error starting emacs daemon\n", progname); |
| 1621 | exit (EXIT_FAILURE); | 1614 | exit (EXIT_FAILURE); |
| 1622 | } | 1615 | } |
| 1623 | # else /* WINDOWSNT */ | 1616 | #else /* WINDOWSNT */ |
| 1624 | DWORD wait_result; | 1617 | DWORD wait_result; |
| 1625 | HANDLE w32_daemon_event; | 1618 | HANDLE w32_daemon_event; |
| 1626 | STARTUPINFO si; | 1619 | STARTUPINFO si; |
| @@ -1684,7 +1677,7 @@ start_daemon_and_retry_set_socket (void) | |||
| 1684 | if (!w32_window_app ()) | 1677 | if (!w32_window_app ()) |
| 1685 | message (true, | 1678 | message (true, |
| 1686 | "Emacs daemon should have started, trying to connect again\n"); | 1679 | "Emacs daemon should have started, trying to connect again\n"); |
| 1687 | # endif /* WINDOWSNT */ | 1680 | #endif /* WINDOWSNT */ |
| 1688 | 1681 | ||
| 1689 | HSOCKET emacs_socket = set_socket (true); | 1682 | HSOCKET emacs_socket = set_socket (true); |
| 1690 | if (emacs_socket == INVALID_SOCKET) | 1683 | if (emacs_socket == INVALID_SOCKET) |
| @@ -1704,7 +1697,6 @@ flush_stdout (HSOCKET emacs_socket) | |||
| 1704 | while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR) | 1697 | while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR) |
| 1705 | act_on_signals (emacs_socket); | 1698 | act_on_signals (emacs_socket); |
| 1706 | } | 1699 | } |
| 1707 | #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ | ||
| 1708 | 1700 | ||
| 1709 | int | 1701 | int |
| 1710 | main (int argc, char **argv) | 1702 | main (int argc, char **argv) |
| @@ -1713,23 +1705,18 @@ main (int argc, char **argv) | |||
| 1713 | main_argv = argv; | 1705 | main_argv = argv; |
| 1714 | progname = argv[0] ? argv[0] : "emacsclient"; | 1706 | progname = argv[0] ? argv[0] : "emacsclient"; |
| 1715 | 1707 | ||
| 1716 | #if ! (defined HAVE_SOCKETS && defined HAVE_INET_SOCKETS) | ||
| 1717 | message (true, "%s: Sorry, support for Berkeley sockets is required.\n", | ||
| 1718 | progname); | ||
| 1719 | fail (); | ||
| 1720 | #else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ | ||
| 1721 | int rl = 0; | 1708 | int rl = 0; |
| 1722 | bool skiplf = true; | 1709 | bool skiplf = true; |
| 1723 | char string[BUFSIZ + 1]; | 1710 | char string[BUFSIZ + 1]; |
| 1724 | int exit_status = EXIT_SUCCESS; | 1711 | int exit_status = EXIT_SUCCESS; |
| 1725 | 1712 | ||
| 1726 | # ifdef HAVE_NTGUI | 1713 | #ifdef HAVE_NTGUI |
| 1727 | /* On Windows 7 and later, we need to explicitly associate | 1714 | /* On Windows 7 and later, we need to explicitly associate |
| 1728 | emacsclient with emacs so the UI behaves sensibly. This | 1715 | emacsclient with emacs so the UI behaves sensibly. This |
| 1729 | association does no harm if we're not actually connecting to an | 1716 | association does no harm if we're not actually connecting to an |
| 1730 | Emacs using a window display. */ | 1717 | Emacs using a window display. */ |
| 1731 | w32_set_user_model_id (); | 1718 | w32_set_user_model_id (); |
| 1732 | # endif /* HAVE_NTGUI */ | 1719 | #endif |
| 1733 | 1720 | ||
| 1734 | /* Process options. */ | 1721 | /* Process options. */ |
| 1735 | decode_options (argc, argv); | 1722 | decode_options (argc, argv); |
| @@ -1742,7 +1729,7 @@ main (int argc, char **argv) | |||
| 1742 | exit (EXIT_FAILURE); | 1729 | exit (EXIT_FAILURE); |
| 1743 | } | 1730 | } |
| 1744 | 1731 | ||
| 1745 | # ifndef WINDOWSNT | 1732 | #ifndef WINDOWSNT |
| 1746 | if (tty) | 1733 | if (tty) |
| 1747 | { | 1734 | { |
| 1748 | pid_t pgrp = getpgrp (); | 1735 | pid_t pgrp = getpgrp (); |
| @@ -1750,7 +1737,7 @@ main (int argc, char **argv) | |||
| 1750 | if (0 <= tcpgrp && tcpgrp != pgrp) | 1737 | if (0 <= tcpgrp && tcpgrp != pgrp) |
| 1751 | kill (-pgrp, SIGTTIN); | 1738 | kill (-pgrp, SIGTTIN); |
| 1752 | } | 1739 | } |
| 1753 | # endif /* !WINDOWSNT */ | 1740 | #endif |
| 1754 | 1741 | ||
| 1755 | /* If alternate_editor is the empty string, start the emacs daemon | 1742 | /* If alternate_editor is the empty string, start the emacs daemon |
| 1756 | in case of failure to connect. */ | 1743 | in case of failure to connect. */ |
| @@ -1774,10 +1761,10 @@ main (int argc, char **argv) | |||
| 1774 | fail (); | 1761 | fail (); |
| 1775 | } | 1762 | } |
| 1776 | 1763 | ||
| 1777 | # ifdef HAVE_NTGUI | 1764 | #ifdef HAVE_NTGUI |
| 1778 | if (display && !strcmp (display, "w32")) | 1765 | if (display && !strcmp (display, "w32")) |
| 1779 | w32_give_focus (); | 1766 | w32_give_focus (); |
| 1780 | # endif /* HAVE_NTGUI */ | 1767 | #endif |
| 1781 | 1768 | ||
| 1782 | /* Send over our environment and current directory. */ | 1769 | /* Send over our environment and current directory. */ |
| 1783 | if (create_frame) | 1770 | if (create_frame) |
| @@ -1879,7 +1866,7 @@ main (int argc, char **argv) | |||
| 1879 | continue; | 1866 | continue; |
| 1880 | } | 1867 | } |
| 1881 | } | 1868 | } |
| 1882 | # ifdef WINDOWSNT | 1869 | #ifdef WINDOWSNT |
| 1883 | else if (! IS_ABSOLUTE_FILE_NAME (argv[i]) | 1870 | else if (! IS_ABSOLUTE_FILE_NAME (argv[i]) |
| 1884 | && (isalpha (argv[i][0]) && argv[i][1] == ':')) | 1871 | && (isalpha (argv[i][0]) && argv[i][1] == ':')) |
| 1885 | /* Windows can have a different default directory for each | 1872 | /* Windows can have a different default directory for each |
| @@ -1898,7 +1885,7 @@ main (int argc, char **argv) | |||
| 1898 | else | 1885 | else |
| 1899 | free (filename); | 1886 | free (filename); |
| 1900 | } | 1887 | } |
| 1901 | # endif | 1888 | #endif |
| 1902 | 1889 | ||
| 1903 | send_to_emacs (emacs_socket, "-file "); | 1890 | send_to_emacs (emacs_socket, "-file "); |
| 1904 | if (tramp_prefix && IS_ABSOLUTE_FILE_NAME (argv[i])) | 1891 | if (tramp_prefix && IS_ABSOLUTE_FILE_NAME (argv[i])) |
| @@ -2008,7 +1995,6 @@ main (int argc, char **argv) | |||
| 2008 | skiplf = str[strlen (str) - 1] == '\n'; | 1995 | skiplf = str[strlen (str) - 1] == '\n'; |
| 2009 | exit_status = EXIT_FAILURE; | 1996 | exit_status = EXIT_FAILURE; |
| 2010 | } | 1997 | } |
| 2011 | # ifdef SIGSTOP | ||
| 2012 | else if (strprefix ("-suspend ", p)) | 1998 | else if (strprefix ("-suspend ", p)) |
| 2013 | { | 1999 | { |
| 2014 | /* -suspend: Suspend this terminal, i.e., stop the process. */ | 2000 | /* -suspend: Suspend this terminal, i.e., stop the process. */ |
| @@ -2017,7 +2003,6 @@ main (int argc, char **argv) | |||
| 2017 | skiplf = true; | 2003 | skiplf = true; |
| 2018 | kill (0, SIGSTOP); | 2004 | kill (0, SIGSTOP); |
| 2019 | } | 2005 | } |
| 2020 | # endif | ||
| 2021 | else | 2006 | else |
| 2022 | { | 2007 | { |
| 2023 | /* Unknown command. */ | 2008 | /* Unknown command. */ |
| @@ -2036,5 +2021,4 @@ main (int argc, char **argv) | |||
| 2036 | 2021 | ||
| 2037 | CLOSE_SOCKET (emacs_socket); | 2022 | CLOSE_SOCKET (emacs_socket); |
| 2038 | return exit_status; | 2023 | return exit_status; |
| 2039 | #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ | ||
| 2040 | } | 2024 | } |