diff -dur gcl-2.6.7.ORIG/h/linux.h gcl-2.6.7/h/linux.h --- gcl-2.6.7.ORIG/h/linux.h 2008-11-03 16:58:16.000000000 -0700 +++ gcl-2.6.7/h/linux.h 2008-11-04 14:53:56.000000000 -0700 @@ -85,13 +85,7 @@ #define SV_ONSTACK 0 #endif -/* unblock signals m and n, and set val to signal_mask(m) | signal_mask(n) - if they were set */ -#define SIG_UNBLOCK_SIGNALS(val,m,n) \ - current_mask = sigblock(0); \ - sigsetmask(~(sigmask(m)) & ~(sigmask(n)) & current_mask); \ - result = (current_mask & sigmask(m) ? signal_mask(m) : 0) \ - | (current_mask & sigmask(n) ? signal_mask(n) : 0); +#define HAVE_SIGPROCMASK #define RUN_PROCESS diff -dur gcl-2.6.7.ORIG/o/run_process.c gcl-2.6.7/o/run_process.c --- gcl-2.6.7.ORIG/o/run_process.c 2008-11-03 16:58:56.000000000 -0700 +++ gcl-2.6.7/o/run_process.c 2008-11-04 12:04:47.000000000 -0700 @@ -527,9 +527,11 @@ if (fork() == 0) { /* the child --- replace standard in and out with descriptors given */ close(0); - dup(fdin); + dup2(fdin, 0); close(1); - dup(fdout); + dup2(fdout, 1); + close(fdin); + close(fdout); fprintf(stderr, "\n***** Spawning process %s ", pname); if (execvp(pname, argv) == -1) { diff -dur gcl-2.6.7.ORIG/o/unixfsys.c gcl-2.6.7/o/unixfsys.c --- gcl-2.6.7.ORIG/o/unixfsys.c 2008-11-03 16:58:56.000000000 -0700 +++ gcl-2.6.7/o/unixfsys.c 2008-11-04 14:54:41.000000000 -0700 @@ -150,17 +150,6 @@ #endif -#ifdef HAVE_GETCWD -char * -getwd(char *buffer) -{ -#ifndef _WIN32 - char *getcwd(char *, size_t); -#endif - return(getcwd(buffer, MAXPATHLEN)); -} -#endif - #ifdef DGUX @@ -278,6 +267,8 @@ if ( 0 == current_directory_length ) { FEerror ( "truename could not determine the current directory.", 1, "" ); } +#elif defined(HAVE_GETCWD) + getcwd(current_directory, MAXPATHLEN); #else getwd(current_directory); #endif @@ -361,6 +352,8 @@ FEerror ( "truename could not determine the current directory.", 1, "" ); } p = directory; +#elif defined(HAVE_GETCWD) + p = getcwd(directory, MAXPATHLEN); #else p = getwd(directory); #endif @@ -448,11 +441,9 @@ backup_fopen(char *filename, char *option) { char backupfilename[MAXPATHLEN]; - char command[MAXPATHLEN * 2]; strcat(strcpy(backupfilename, filename), ".BAK"); - sprintf(command, "mv %s %s", filename, backupfilename); - system(command); + rename(filename, backupfilename); return(fopen(filename, option)); }