From: Hans-Bernhard B. <br...@us...> - 2001-03-29 15:03:59
|
Update of /cvsroot/cscope/cscope/src In directory usw-pr-cvs1:/tmp/cvs-serv16234/src Modified Files: exec.c main.c Log Message: Some more DJGPP patches: curses, sub-processes, and close-before-unlink Index: exec.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/exec.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** exec.c 2001/03/27 14:09:19 1.4 --- exec.c 2001/03/29 15:03:55 1.5 *************** *** 41,44 **** --- 41,47 ---- #include <sys/wait.h> #include <sys/types.h> /* pid_t */ + #ifdef __DJGPP__ + #include <process.h> + #endif #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES) #include <ncurses.h> *************** *** 53,59 **** --- 56,64 ---- static RETSIGTYPE (*oldsigstp)(); + #ifndef __MSDOS__ /* none of these is needed, there */ static int join(pid_t p); static int myexecvp(char *a, char **args); static pid_t myfork(void); + #endif /* execute forks and executes a program or shell script, waits for it to *************** *** 78,81 **** --- 83,91 ---- for (p = 0; (argv[p] = va_arg(ap, char *)) != 0; p++) ; + #ifdef __MSDOS__ + /* HBB 20010313: in MSDOG, everything is completely different. + * No fork()/exec()/wait(), but rather a single libc call: */ + exitcode = spawnvp(P_WAIT, a, argv); + #else if ((p = myfork()) == 0) { (void) myexecvp(a, argv); /* child */ *************** *** 84,90 **** --- 94,104 ---- exitcode = join(p); /* parent */ } + #endif /* MSDOS */ + /* the menu and scrollbar may be changed by the command executed */ #if UNIXPC || !TERMINFO + # ifndef __DJGPP__ /* leave CRLF handling as is */ nonl(); + # endif cbreak(); /* endwin() turns off cbreak mode so restore it */ noecho(); *************** *** 96,99 **** --- 110,115 ---- } + #ifndef __MSDOS__ /* None of the following functions is used, there */ + /* myexecvp is an interface to the execvp system call to * modify argv[0] to reference the last component of its path-name. *************** *** 173,174 **** --- 189,192 ---- return(status >> 8); } + + #endif /* !MSDOS */ Index: main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** main.c 2001/03/27 14:09:19 1.17 --- main.c 2001/03/29 15:03:55 1.18 *************** *** 1360,1364 **** --- 1360,1366 ---- { incurses = YES; + #ifndef __MSDOS__ /* HBB 20010313 */ (void) nonl(); /* don't translate an output \n to \n\r */ + #endif (void) cbreak(); /* single character input */ (void) noecho(); /* don't echo input characters */ *************** *** 1435,1438 **** --- 1437,1445 ---- myexit(int sig) { + /* HBB 20010313; close file before unlinking it. Unix may not care + * about that, but DOS absolutely needs it */ + if (refsfound != NULL) + fclose(refsfound); + /* remove any temporary files */ if (temp1[0] != '\0') { |