aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorDaniel Colascione2012-09-17 04:07:36 -0800
committerDaniel Colascione2012-09-17 04:07:36 -0800
commit2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch)
tree6dd6784d63e54cb18071df8e28fbdbc27d418728 /src/w32.c
parentf701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff)
parentbb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff)
downloademacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz
emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.zip
Merge from trunk
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c60
1 files changed, 17 insertions, 43 deletions
diff --git a/src/w32.c b/src/w32.c
index d779d740724..d79065e76e0 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include <sys/time.h> 32#include <sys/time.h>
33#include <sys/utime.h> 33#include <sys/utime.h>
34#include <math.h> 34#include <math.h>
35#include <setjmp.h>
36#include <time.h> 35#include <time.h>
37 36
38/* must include CRT headers *before* config.h */ 37/* must include CRT headers *before* config.h */
@@ -1256,9 +1255,9 @@ init_user_info (void)
1256 1255
1257 /* Ensure HOME and SHELL are defined. */ 1256 /* Ensure HOME and SHELL are defined. */
1258 if (getenv ("HOME") == NULL) 1257 if (getenv ("HOME") == NULL)
1259 abort (); 1258 emacs_abort ();
1260 if (getenv ("SHELL") == NULL) 1259 if (getenv ("SHELL") == NULL)
1261 abort (); 1260 emacs_abort ();
1262 1261
1263 /* Set dir and shell from environment variables. */ 1262 /* Set dir and shell from environment variables. */
1264 strcpy (dflt_passwd.pw_dir, getenv ("HOME")); 1263 strcpy (dflt_passwd.pw_dir, getenv ("HOME"));
@@ -1513,34 +1512,10 @@ is_unc_volume (const char *filename)
1513} 1512}
1514 1513
1515/* Routines that are no-ops on NT but are defined to get Emacs to compile. */ 1514/* Routines that are no-ops on NT but are defined to get Emacs to compile. */
1516
1517int
1518sigsetmask (int signal_mask)
1519{
1520 return 0;
1521}
1522
1523int
1524sigmask (int sig)
1525{
1526 return 0;
1527}
1528
1529int
1530sigblock (int sig)
1531{
1532 return 0;
1533}
1534
1535int
1536sigunblock (int sig)
1537{
1538 return 0;
1539}
1540
1541int 1515int
1542sigemptyset (sigset_t *set) 1516sigemptyset (sigset_t *set)
1543{ 1517{
1518 *set = 0;
1544 return 0; 1519 return 0;
1545} 1520}
1546 1521
@@ -1771,9 +1746,9 @@ init_environment (char ** argv)
1771 char modname[MAX_PATH]; 1746 char modname[MAX_PATH];
1772 1747
1773 if (!GetModuleFileName (NULL, modname, MAX_PATH)) 1748 if (!GetModuleFileName (NULL, modname, MAX_PATH))
1774 abort (); 1749 emacs_abort ();
1775 if ((p = strrchr (modname, '\\')) == NULL) 1750 if ((p = strrchr (modname, '\\')) == NULL)
1776 abort (); 1751 emacs_abort ();
1777 *p = 0; 1752 *p = 0;
1778 1753
1779 if ((p = strrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0) 1754 if ((p = strrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0)
@@ -1885,13 +1860,13 @@ init_environment (char ** argv)
1885 /* FIXME: Do we need to resolve possible symlinks in startup_dir? 1860 /* FIXME: Do we need to resolve possible symlinks in startup_dir?
1886 Does it matter anywhere in Emacs? */ 1861 Does it matter anywhere in Emacs? */
1887 if (!GetCurrentDirectory (MAXPATHLEN, startup_dir)) 1862 if (!GetCurrentDirectory (MAXPATHLEN, startup_dir))
1888 abort (); 1863 emacs_abort ();
1889 1864
1890 { 1865 {
1891 static char modname[MAX_PATH]; 1866 static char modname[MAX_PATH];
1892 1867
1893 if (!GetModuleFileName (NULL, modname, MAX_PATH)) 1868 if (!GetModuleFileName (NULL, modname, MAX_PATH))
1894 abort (); 1869 emacs_abort ();
1895 argv[0] = modname; 1870 argv[0] = modname;
1896 } 1871 }
1897 1872
@@ -1913,7 +1888,7 @@ emacs_root_dir (void)
1913 1888
1914 p = getenv ("emacs_dir"); 1889 p = getenv ("emacs_dir");
1915 if (p == NULL) 1890 if (p == NULL)
1916 abort (); 1891 emacs_abort ();
1917 strcpy (root_dir, p); 1892 strcpy (root_dir, p);
1918 root_dir[parse_root (root_dir, NULL)] = '\0'; 1893 root_dir[parse_root (root_dir, NULL)] = '\0';
1919 dostounix_filename (root_dir); 1894 dostounix_filename (root_dir);
@@ -3270,7 +3245,7 @@ generate_inode_val (const char * name)
3270 doesn't resolve aliasing due to subst commands, or recognize hard 3245 doesn't resolve aliasing due to subst commands, or recognize hard
3271 links. */ 3246 links. */
3272 if (!w32_get_long_filename ((char *)name, fullname, MAX_PATH)) 3247 if (!w32_get_long_filename ((char *)name, fullname, MAX_PATH))
3273 abort (); 3248 emacs_abort ();
3274 3249
3275 parse_root (fullname, &p); 3250 parse_root (fullname, &p);
3276 /* Normal W32 filesystems are still case insensitive. */ 3251 /* Normal W32 filesystems are still case insensitive. */
@@ -5570,7 +5545,7 @@ socket_to_fd (SOCKET s)
5570 if (fd_info[ fd ].cp != NULL) 5545 if (fd_info[ fd ].cp != NULL)
5571 { 5546 {
5572 DebPrint (("sys_socket: fd_info[%d] apparently in use!\n", fd)); 5547 DebPrint (("sys_socket: fd_info[%d] apparently in use!\n", fd));
5573 abort (); 5548 emacs_abort ();
5574 } 5549 }
5575 5550
5576 fd_info[ fd ].cp = cp; 5551 fd_info[ fd ].cp = cp;
@@ -5949,7 +5924,7 @@ sys_close (int fd)
5949 { 5924 {
5950 if (fd_info[fd].flags & FILE_SOCKET) 5925 if (fd_info[fd].flags & FILE_SOCKET)
5951 { 5926 {
5952 if (winsock_lib == NULL) abort (); 5927 if (winsock_lib == NULL) emacs_abort ();
5953 5928
5954 pfn_shutdown (SOCK_HANDLE (fd), 2); 5929 pfn_shutdown (SOCK_HANDLE (fd), 2);
5955 rc = pfn_closesocket (SOCK_HANDLE (fd)); 5930 rc = pfn_closesocket (SOCK_HANDLE (fd));
@@ -6067,7 +6042,7 @@ _sys_read_ahead (int fd)
6067 || (fd_info[fd].flags & FILE_READ) == 0) 6042 || (fd_info[fd].flags & FILE_READ) == 0)
6068 { 6043 {
6069 DebPrint (("_sys_read_ahead: internal error: fd %d is not a pipe, serial port, or socket!\n", fd)); 6044 DebPrint (("_sys_read_ahead: internal error: fd %d is not a pipe, serial port, or socket!\n", fd));
6070 abort (); 6045 emacs_abort ();
6071 } 6046 }
6072 6047
6073 cp->status = STATUS_READ_IN_PROGRESS; 6048 cp->status = STATUS_READ_IN_PROGRESS;
@@ -6203,7 +6178,7 @@ sys_read (int fd, char * buffer, unsigned int count)
6203 /* re-read CR carried over from last read */ 6178 /* re-read CR carried over from last read */
6204 if (fd_info[fd].flags & FILE_LAST_CR) 6179 if (fd_info[fd].flags & FILE_LAST_CR)
6205 { 6180 {
6206 if (fd_info[fd].flags & FILE_BINARY) abort (); 6181 if (fd_info[fd].flags & FILE_BINARY) emacs_abort ();
6207 *buffer++ = 0x0d; 6182 *buffer++ = 0x0d;
6208 count--; 6183 count--;
6209 nchars++; 6184 nchars++;
@@ -6306,7 +6281,7 @@ sys_read (int fd, char * buffer, unsigned int count)
6306 } 6281 }
6307 else /* FILE_SOCKET */ 6282 else /* FILE_SOCKET */
6308 { 6283 {
6309 if (winsock_lib == NULL) abort (); 6284 if (winsock_lib == NULL) emacs_abort ();
6310 6285
6311 /* do the equivalent of a non-blocking read */ 6286 /* do the equivalent of a non-blocking read */
6312 pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); 6287 pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting);
@@ -6457,7 +6432,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
6457 else if (fd < MAXDESC && fd_info[fd].flags & FILE_SOCKET) 6432 else if (fd < MAXDESC && fd_info[fd].flags & FILE_SOCKET)
6458 { 6433 {
6459 unsigned long nblock = 0; 6434 unsigned long nblock = 0;
6460 if (winsock_lib == NULL) abort (); 6435 if (winsock_lib == NULL) emacs_abort ();
6461 6436
6462 /* TODO: implement select() properly so non-blocking I/O works. */ 6437 /* TODO: implement select() properly so non-blocking I/O works. */
6463 /* For now, make sure the write blocks. */ 6438 /* For now, make sure the write blocks. */
@@ -6623,8 +6598,7 @@ check_windows_init_file (void)
6623 buffer, 6598 buffer,
6624 "Emacs Abort Dialog", 6599 "Emacs Abort Dialog",
6625 MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); 6600 MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL);
6626 /* Use the low-level Emacs abort. */ 6601 /* Use the low-level system abort. */
6627#undef abort
6628 abort (); 6602 abort ();
6629 } 6603 }
6630 else 6604 else
@@ -6756,7 +6730,7 @@ shutdown_handler (DWORD type)
6756 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */ 6730 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */
6757 { 6731 {
6758 /* Shut down cleanly, making sure autosave files are up to date. */ 6732 /* Shut down cleanly, making sure autosave files are up to date. */
6759 shut_down_emacs (0, 0, Qnil); 6733 shut_down_emacs (0, Qnil);
6760 } 6734 }
6761 6735
6762 /* Allow other handlers to handle this signal. */ 6736 /* Allow other handlers to handle this signal. */