|
From: Hans-Bernhard B. <br...@us...> - 2001-10-19 15:32:31
|
Update of /cvsroot/cscope/cscope/src
In directory usw-pr-cvs1:/tmp/cvs-serv28779/src
Modified Files:
display.c command.c
Log Message:
Work around some Linux' buggy freopen()
Index: display.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/display.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** display.c 2001/08/15 13:04:14 1.18
--- display.c 2001/10/19 15:32:27 1.19
***************
*** 445,449 ****
/* append the non-global references */
! (void) freopen(temp2, "rb", nonglobalrefs);
while ((c = getc(nonglobalrefs)) != EOF) {
(void) putc(c, refsfound);
--- 445,453 ----
/* append the non-global references */
! (void) fclose(nonglobalrefs);
! if ( (nonglobalrefs = myfopen(temp2, "rb")) == NULL) {
! cannotopen(temp2);
! return(NO);
! }
while ((c = getc(nonglobalrefs)) != EOF) {
(void) putc(c, refsfound);
***************
*** 459,463 ****
/* reopen the references found file for reading */
! (void) freopen(temp1, "rb", refsfound);
nextline = 1;
totallines = 0;
--- 463,471 ----
/* reopen the references found file for reading */
! (void) fclose(refsfound);
! if ( (refsfound = myfopen(temp1, "rb")) == NULL) {
! cannotopen(temp1);
! return(NO);
! }
nextline = 1;
totallines = 0;
***************
*** 746,753 ****
return(NO);
}
! }
! else if (freopen(temp1, "wb", refsfound) == NULL) {
! postmsg("Cannot reopen temporary file");
! return(NO);
}
return(YES);
--- 754,763 ----
return(NO);
}
! } else {
! (void) fclose(refsfound);
! if ( (refsfound = myfopen(temp1, "wb")) == NULL) {
! postmsg("Cannot reopen temporary file");
! return(NO);
! }
}
return(YES);
Index: command.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/command.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** command.c 2001/08/15 13:04:14 1.15
--- command.c 2001/10/19 15:32:27 1.16
***************
*** 570,574 ****
}
(void) fclose(file);
! (void) freopen(temp1, "rb", refsfound);
countrefs();
}
--- 570,578 ----
}
(void) fclose(file);
! (void) fclose(refsfound);
! if ( (refsfound = myfopen(temp1, "rb")) == NULL) {
! cannotopen(temp1);
! return(NO);
! }
countrefs();
}
|