[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104154: Adapt the MS-DOS build to la
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104154: Adapt the MS-DOS build to latest changes. |
Date: |
Sat, 07 May 2011 14:28:55 +0300 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104154 [merge]
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2011-05-07 14:28:55 +0300
message:
Adapt the MS-DOS build to latest changes.
src/callproc.c (call_process_cleanup): Don't close and unlink the
temporary file if Fcall_process didn't create it in the first
place.
(Fcall_process): Don't create tempfile if stdout of the child
process will be redirected to a file specified with `:file'.
Don't try to re-open tempfile in that case, and set fd[0] to -1 as
cue to call_process_cleanup not to close that handle.
msdos/inttypes.h: Include stdint.h.
(uintmax_t): Don't define, it is defined in stdint.h.
msdos/sedlibmk.inp (am__append_1): Edit to comment out.
(am__append_2): Edit to expose.
(NEXT_AS_FIRST_DIRECTIVE_STDARG_H, NEXT_STDARG_H, STDARG_H): Edit
to empty.
(@GL_GENERATE_STDARG_H_TRUE@, @GL_GENERATE_STDARG_H_FALSE@): Edit
to comment out corresponding lines.
modified:
msdos/ChangeLog
msdos/inttypes.h
msdos/sedlibmk.inp
src/ChangeLog
src/callproc.c
=== modified file 'msdos/ChangeLog'
--- a/msdos/ChangeLog 2011-04-30 10:31:17 +0000
+++ b/msdos/ChangeLog 2011-05-07 10:24:55 +0000
@@ -1,3 +1,15 @@
+2011-05-07 Eli Zaretskii <address@hidden>
+
+ * inttypes.h: Include stdint.h.
+ (uintmax_t): Don't define, it is defined in stdint.h.
+
+ * sedlibmk.inp (am__append_1): Edit to comment out.
+ (am__append_2): Edit to expose.
+ (NEXT_AS_FIRST_DIRECTIVE_STDARG_H, NEXT_STDARG_H, STDARG_H): Edit
+ to empty.
+ (@GL_GENERATE_STDARG_H_TRUE@, @GL_GENERATE_STDARG_H_FALSE@): Edit
+ to comment out corresponding lines.
+
2011-04-30 Eli Zaretskii <address@hidden>
* inttypes.h: New file.
=== modified file 'msdos/inttypes.h'
--- a/msdos/inttypes.h 2011-04-30 10:31:17 +0000
+++ b/msdos/inttypes.h 2011-05-07 10:24:55 +0000
@@ -20,11 +20,15 @@
#ifndef _REPL_INTTYPES_H
#define _REPL_INTTYPES_H
+/* As of May 2011, DJGPP v2.04 does not include stdint.h in its
+ inttypes.h, although it should. Therefore, include stdint.h
+ unconditionally. */
+#include <stdint.h>
+
#if __DJGPP__ > 2 || __DJGPP_MINOR__ >= 4
#include_next <inttypes.h>
#else /* __DJGPP__ < 2.04 */
#include <stdlib.h>
-#define uintmax_t unsigned long long
#define strtoumax strtoull
#endif /* __DJGPP__ < 2.04 */
=== modified file 'msdos/sedlibmk.inp'
--- a/msdos/sedlibmk.inp 2011-04-30 10:31:17 +0000
+++ b/msdos/sedlibmk.inp 2011-05-07 10:24:55 +0000
@@ -401,6 +401,7 @@
# MKDIR_P lines are edited further below
/^MKDIR_P *=/s/@MKDIR_P@//
/^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@address@hidden@/<getopt.h>/
+/^NEXT_AS_FIRST_DIRECTIVE_STDARG_H *=/s/@address@hidden@//
/^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@address@hidden@//
/^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@address@hidden@/<stdint.h>/
/^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@address@hidden@/<stdio.h>/
@@ -409,6 +410,7 @@
/^NEXT_AS_FIRST_DIRECTIVE_TIME_H *=/s/@address@hidden@/<time.h>/
/^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H *=/s/@address@hidden@/<unistd.h>/
/^NEXT_GETOPT_H *=/s/@address@hidden@/<getopt.h>/
+/^NEXT_STDARG_H *=/s/@address@hidden@//
/^NEXT_STDDEF_H *=/s/@address@hidden@//
/^NEXT_STDIO_H *=/s/@address@hidden@/<stdio.h>/
/^NEXT_STDINT_H *=/s/@address@hidden@/<stdint.h>/
@@ -506,6 +508,7 @@
/^SIG_ATOMIC_T_SUFFIX *=/s/@SIG_ATOMIC_T_SUFFIX@//
/^SIZE_T_SUFFIX *=/s/@SIZE_T_SUFFIX@/u/
/^STDBOOL_H *=/s/@address@hidden@//
+/^STDARG_H *=/s/@address@hidden@//
/^STDDEF_H *=/s/@address@hidden@//
/^STDINT_H *=/s/@address@hidden@/stdint.h/
/^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@address@hidden@/0/
@@ -514,6 +517,8 @@
/^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS *=/s/@address@hidden@/0/
/^WCHAR_T_SUFFIX *=/s/@WCHAR_T_SUFFIX@/h/
/^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@//
+/am__append_1 *=.*gettext\.h/s/@address@hidden@/\#/
+/am__append_2 *=.*verify\.h/s/@address@hidden@//
/^gl_LIBOBJS *=/s/@address@hidden@/getopt.o getopt1.o strftime.o time_r.o
getloadavg.o md5.o filemode.o/
/^BUILT_SOURCES *=/s/ *inttypes\.h//
/^am_libgnu_a_OBJECTS *=/s/careadlinkat\.\$(OBJEXT)//
@@ -554,8 +559,10 @@
# Fix the recipes for header files
s/address@hidden@/\#/
s/address@hidden@//
+s/address@hidden@/\#/
+s/address@hidden@/\#/
s/address@hidden@/\#/
-s/address@hidden@//
+s/address@hidden@/\#/
s/address@hidden@//
s/address@hidden@/\#/
/^arg-nonnull\.h:/,/^[ ][ ]*mv /c\
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-05-07 04:00:12 +0000
+++ b/src/ChangeLog 2011-05-07 11:25:05 +0000
@@ -1,3 +1,13 @@
+2011-05-07 Eli Zaretskii <address@hidden>
+
+ * callproc.c (call_process_cleanup): Don't close and unlink the
+ temporary file if Fcall_process didn't create it in the first
+ place.
+ (Fcall_process): Don't create tempfile if stdout of the child
+ process will be redirected to a file specified with `:file'.
+ Don't try to re-open tempfile in that case, and set fd[0] to -1 as
+ cue to call_process_cleanup not to close that handle.
+
2011-05-07 Ben Key <address@hidden>
* makefile.w32-in: The bootstrap-temacs rule now makes use of
=== modified file 'src/callproc.c'
--- a/src/callproc.c 2011-05-06 07:13:19 +0000
+++ b/src/callproc.c 2011-05-07 11:25:05 +0000
@@ -114,6 +114,7 @@
Lisp_Object fdpid = Fcdr (arg);
#if defined (MSDOS)
Lisp_Object file;
+ int fd;
#else
int pid;
#endif
@@ -122,9 +123,13 @@
#if defined (MSDOS)
/* for MSDOS fdpid is really (fd . tempfile) */
+ fd = XFASTINT (Fcar (fdpid));
file = Fcdr (fdpid);
- emacs_close (XFASTINT (Fcar (fdpid)));
- if (strcmp (SDATA (file), NULL_DEVICE) != 0)
+ /* FD is -1 and FILE is "" when we didn't actually create a
+ temporary file in call-process. */
+ if (fd >= 0)
+ emacs_close (fd);
+ if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
unlink (SDATA (file));
#else /* not MSDOS */
pid = XFASTINT (Fcdr (fdpid));
@@ -199,7 +204,7 @@
Lisp_Object error_file;
Lisp_Object output_file = Qnil;
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
- char *outf, *tempfile;
+ char *outf, *tempfile = NULL;
int outfilefd;
#endif
int fd_output = -1;
@@ -439,22 +444,23 @@
new_argv[0] = SDATA (path);
#ifdef MSDOS /* MW, July 1993 */
- if ((outf = egetenv ("TMPDIR")))
- strcpy (tempfile = alloca (strlen (outf) + 20), outf);
- else
- {
- tempfile = alloca (20);
- *tempfile = '\0';
- }
- dostounix_filename (tempfile);
- if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
- strcat (tempfile, "/");
- strcat (tempfile, "detmp.XXX");
- mktemp (tempfile);
- /* If we're redirecting STDOUT to a file, this is already opened. */
+ /* If we're redirecting STDOUT to a file, that file is already open
+ on fd_output. */
if (fd_output < 0)
{
+ if ((outf = egetenv ("TMPDIR")))
+ strcpy (tempfile = alloca (strlen (outf) + 20), outf);
+ else
+ {
+ tempfile = alloca (20);
+ *tempfile = '\0';
+ }
+ dostounix_filename (tempfile);
+ if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
+ strcat (tempfile, "/");
+ strcat (tempfile, "detmp.XXX");
+ mktemp (tempfile);
outfilefd = creat (tempfile, S_IREAD | S_IWRITE);
if (outfilefd < 0) {
emacs_close (filefd);
@@ -561,15 +567,21 @@
if (fd_error != outfilefd)
emacs_close (fd_error);
fd1 = -1; /* No harm in closing that one! */
- /* Since CRLF is converted to LF within `decode_coding', we can
- always open a file with binary mode. */
- fd[0] = emacs_open (tempfile, O_RDONLY | O_BINARY, 0);
- if (fd[0] < 0)
+ if (tempfile)
{
- unlink (tempfile);
- emacs_close (filefd);
- report_file_error ("Cannot re-open temporary file", Qnil);
+ /* Since CRLF is converted to LF within `decode_coding', we
+ can always open a file with binary mode. */
+ fd[0] = emacs_open (tempfile, O_RDONLY | O_BINARY, 0);
+ if (fd[0] < 0)
+ {
+ unlink (tempfile);
+ emacs_close (filefd);
+ report_file_error ("Cannot re-open temporary file",
+ Fcons (tempfile, Qnil));
+ }
}
+ else
+ fd[0] = -1; /* We are not going to read from tempfile. */
#else /* not MSDOS */
#ifdef WINDOWSNT
pid = child_setup (filefd, fd1, fd_error, (char **) new_argv,
@@ -676,7 +688,7 @@
record_unwind_protect (call_process_cleanup,
Fcons (Fcurrent_buffer (),
Fcons (make_number (fd[0]),
- build_string (tempfile))));
+ build_string (tempfile ? tempfile :
""))));
#else
record_unwind_protect (call_process_cleanup,
Fcons (Fcurrent_buffer (),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104154: Adapt the MS-DOS build to latest changes.,
Eli Zaretskii <=