From: Hans-Bernhard B. <br...@us...> - 2001-07-05 18:36:27
|
Update of /cvsroot/cscope/cscope/src In directory usw-pr-cvs1:/tmp/cvs-serv2099 Modified Files: mypopen.c command.c main.c library.h Log Message: Renamed pclose() to mypclose(), avoiding name clash with system version Index: mypopen.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/mypopen.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** mypopen.c 2001/03/27 14:09:19 1.6 --- mypopen.c 2001/07/05 15:08:21 1.7 *************** *** 153,164 **** (void) close(yourside); return(fdopen(myside, mode)); ! #endif } ! #ifndef __DJGPP__ /* Don't replace that system's pclose() with our own. */ ! /* FIXME: should we really override pclose(), after having left ! * popen() well alone, and calling our own version mypopen()? */ int ! pclose(FILE *ptr) { int f; --- 153,163 ---- (void) close(yourside); return(fdopen(myside, mode)); ! #endif /* DJGPP */ } ! /* HBB 20010705: renamed from 'pclose', which would collide with ! * system-supplied function of same name */ int ! mypclose(FILE *ptr) { int f; *************** *** 167,170 **** --- 166,174 ---- RETSIGTYPE (*hstat)(int), (*istat)(int), (*qstat)(int); + #ifdef __DJGPP__ + /* HBB 20010705: This system has its own pclose(), which we + * don't want to replace */ + return (pclose)(ptr); + #else f = fileno(ptr); (void) fclose(ptr); *************** *** 183,186 **** popen_pid[f] = 0; return(status); } - #endif --- 187,190 ---- popen_pid[f] = 0; return(status); + #endif /* DJGPP */ } Index: command.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/command.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** command.c 2001/06/01 12:43:24 1.12 --- command.c 2001/07/05 15:08:21 1.13 *************** *** 388,392 **** } seekline(topline); ! (void) pclose(file); } if (commandc == '^') { --- 388,392 ---- } seekline(topline); ! (void) mypclose(file); } if (commandc == '^') { Index: main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** main.c 2001/07/05 14:31:00 1.21 --- main.c 2001/07/05 15:08:21 1.22 *************** *** 1071,1075 **** cannotindex(); } ! (void) pclose(postings); } (void) unlink(temp1); --- 1071,1075 ---- cannotindex(); } ! (void) mypclose(postings); } (void) unlink(temp1); Index: library.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/library.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** library.h 2001/07/05 14:31:00 1.6 --- library.h 2001/07/05 15:08:21 1.7 *************** *** 48,51 **** --- 48,52 ---- char *stralloc(char *s); FILE *mypopen(char *cmd, char *mode); + int mypclose(FILE *ptr); FILE *vpfopen(char *filename, char *type); void egrepcaseless(int i); |