diff src/fileio.c @ 107733:84b961690802

Remove support for DJGPP v1.x (bug#5813). src/: w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility. s/msdos.h: unexec.c (make_hdr, copy_text_and_data): sysdep.c (wait_for_termination, sys_subshell): msdos.c (dos_set_window_size, msdos_set_cursor_shape) (IT_set_terminal_modes): (__write, _rename, gethostname, gettimeofday, alarm, fork, kill) (dos_ttraw, dos_ttcooked, run_msdos_command, abort): Remove DJGPP v1.x code and tests of the value of __DJGPP__. (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x compatibility code. lread.c: gmalloc.c (memalign): fileio.c (Fcopy_file, check_executable, Ffile_modes): emacs.c (main): dosfns.c (init_dosfns): dired.c (file_name_completion_stat): Remove tests of __DJGPP__. msdos/: sed3.inp: sed2.inp: sed1.inp: mainmake: Files removed.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 01 Apr 2010 17:59:46 +0300
parents fddcde0a4c70
children 912a8c0c9a8a
line wrap: on
line diff
--- a/src/fileio.c	Thu Apr 01 15:37:28 2010 +0300
+++ b/src/fileio.c	Thu Apr 01 17:59:46 2010 +0300
@@ -79,11 +79,9 @@
 #ifdef MSDOS
 #include "msdos.h"
 #include <sys/param.h>
-#if __DJGPP__ >= 2
 #include <fcntl.h>
 #include <string.h>
 #endif
-#endif
 
 #ifdef DOS_NT
 #define CORRECT_DIR_SEPS(s) \
@@ -2012,7 +2010,6 @@
      copyable by us. */
   input_file_statable_p = (fstat (ifd, &st) >= 0);
 
-#if !defined (MSDOS) || __DJGPP__ > 1
   if (out_st.st_mode != 0
       && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
     {
@@ -2020,7 +2017,6 @@
       report_file_error ("Input and output files are the same",
 			 Fcons (file, Fcons (newname, Qnil)));
     }
-#endif
 
 #if defined (S_ISREG) && defined (S_ISLNK)
   if (input_file_statable_p)
@@ -2091,7 +2087,7 @@
 
   emacs_close (ifd);
 
-#if defined (__DJGPP__) && __DJGPP__ > 1
+#ifdef MSDOS
   if (input_file_statable_p)
     {
       /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
@@ -2101,7 +2097,7 @@
       if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
 	chmod (SDATA (encoded_newname), st.st_mode & 07777);
     }
-#endif /* DJGPP version 2 or newer */
+#endif /* MSDOS */
 #endif /* not WINDOWSNT */
 
   /* Discard the unwind protects.  */
@@ -2477,16 +2473,7 @@
   struct stat st;
   if (stat (filename, &st) < 0)
     return 0;
-#if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1)
   return ((st.st_mode & S_IEXEC) != 0);
-#else
-  return (S_ISREG (st.st_mode)
-	  && len >= 5
-	  && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0
-	      || xstrcasecmp (suffix, ".exe") == 0
-	      || xstrcasecmp (suffix, ".bat") == 0)
-	  || (st.st_mode & S_IFMT) == S_IFDIR);
-#endif /* not WINDOWSNT */
 #else /* not DOS_NT */
 #ifdef HAVE_EUIDACCESS
   return (euidaccess (filename, 1) >= 0);
@@ -2885,10 +2872,6 @@
 
   if (stat (SDATA (absname), &st) < 0)
     return Qnil;
-#if defined (MSDOS) && __DJGPP__ < 2
-  if (check_executable (SDATA (absname)))
-    st.st_mode |= S_IEXEC;
-#endif /* MSDOS && __DJGPP__ < 2 */
 
   return make_number (st.st_mode & 07777);
 }