From 3480d92bb007bebdb644afbe667a02c00edbb334 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 23 Sep 2005 17:06:03 +0000 Subject: [PATCH] * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): Define BROKEN_GET_CURRENT_DIR_NAME. * sysdep.c (get_current_dir_name): Also define if BROKEN_GET_CURRENT_DIR_NAME. * m/ibmrs6000.h: Test for USG5, not USG5_4. --- src/ChangeLog | 10 ++++++++++ src/m/ibmrs6000.h | 2 +- src/s/aix4-2.h | 18 ++++++++++++++++++ src/sysdep.c | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 62e82540ac..2260e004f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2005-09-23 Dan Nicolaescu + + * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): Define + BROKEN_GET_CURRENT_DIR_NAME. + + * sysdep.c (get_current_dir_name): Also define if + BROKEN_GET_CURRENT_DIR_NAME. + + * m/ibmrs6000.h: Test for USG5, not USG5_4. + 2005-09-22 Kim F. Storm * xdisp.c (message_dolog): Add warning about GC and Lisp strings. diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h index 9559f1ae62..0ff702d090 100644 --- a/src/m/ibmrs6000.h +++ b/src/m/ibmrs6000.h @@ -112,7 +112,7 @@ Boston, MA 02110-1301, USA. */ #define OBJECTS_MACHINE hftctl.o #endif -#ifndef USG5_4 +#ifndef USG5 #define C_SWITCH_MACHINE -D_BSD #endif diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index 66b7d322b5..02225a9226 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -2,5 +2,23 @@ #undef ALIGN_DATA_RELOC +/* On AIX Emacs uses the gmalloc.c malloc implementation. But given + the way this system works, libc functions that return malloced + memory use the libc malloc implementation. Calling xfree or + xrealloc on the results of such functions results in a crash. + + One solution for this could be to define SYSTEM_MALLOC here, but + that does not currently work on this system. + + It is possible to completely override the malloc implementation on + AIX, but that involves putting the malloc functions in a shared + library and setting the MALLOCTYPE environment variable to point to + tha shared library. + + Emacs currently calls xrealloc on the results of get_current_dir name, + to avoid a crash just use the Emacs implementation for that function. +*/ +#define BROKEN_GET_CURRENT_DIR_NAME 1 + /* arch-tag: 38fe75ea-6aef-42bd-8449-bc34d921a562 (do not change this comment) */ diff --git a/src/sysdep.c b/src/sysdep.c index eae493ba45..f70d4b18cf 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -256,7 +256,7 @@ void hft_reset (); SIGMASKTYPE sigprocmask_set; -#ifndef HAVE_GET_CURRENT_DIR_NAME +#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) /* Return the current working directory. Returns NULL on errors. Any other returned value must be freed with free. This is used -- 2.20.1