|
From: Hans-Bernhard B. <br...@us...> - 2002-07-28 15:40:10
|
Update of /cvsroot/cscope/cscope/src
In directory usw-pr-cvs1:/tmp/cvs-serv25314/src
Modified Files:
Makefile.in alloc.c command.c exec.c global.h logdir.c main.c
mypopen.c vp.h vpopen.c
Log Message:
Cygwin-related fixes:
* move #include <fcntl.h> above #ifdef O_TEXT/O_BINARY detection stuff
* call myexit() instead of exit() everywhere
* enable AC_EXEEXT stuff
Index: Makefile.in
===================================================================
RCS file: /cvsroot/cscope/cscope/src/Makefile.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Makefile.in 2 Jan 2002 17:26:35 -0000 1.6
--- Makefile.in 28 Jul 2002 15:40:06 -0000 1.7
***************
*** 63,66 ****
--- 63,67 ----
CURSES_INCLUDEDIR = @CURSES_INCLUDEDIR@
CURSES_LIBS = @CURSES_LIBS@
+ EXEEXT = @EXEEXT@
LEX = @LEX@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
***************
*** 91,94 ****
--- 92,96 ----
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
+ bin_PROGRAMS = cscope$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
***************
*** 185,190 ****
maintainer-clean-compile:
! cscope: $(cscope_OBJECTS) $(cscope_DEPENDENCIES)
! @rm -f cscope
$(LINK) $(cscope_LDFLAGS) $(cscope_OBJECTS) $(cscope_LDADD) $(LIBS)
.l.c:
--- 187,192 ----
maintainer-clean-compile:
! cscope$(EXEEXT): $(cscope_OBJECTS) $(cscope_DEPENDENCIES)
! @rm -f cscope$(EXEEXT)
$(LINK) $(cscope_LDFLAGS) $(cscope_OBJECTS) $(cscope_LDADD) $(LIBS)
.l.c:
Index: alloc.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/alloc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** alloc.c 9 May 2000 13:37:10 -0000 1.4
--- alloc.c 28 Jul 2002 15:40:07 -0000 1.5
***************
*** 48,52 ****
# else
char *calloc(), *malloc(), *realloc(), *strcpy();
- void exit();
# endif
--- 48,51 ----
***************
*** 90,94 ****
if (p == NULL) {
(void) fprintf(stderr, "\n%s: out of storage\n", argv0);
! exit(1);
}
return(p);
--- 89,93 ----
if (p == NULL) {
(void) fprintf(stderr, "\n%s: out of storage\n", argv0);
! myexit(1);
}
return(p);
Index: command.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/command.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** command.c 8 Jul 2002 15:52:24 -0000 1.18
--- command.c 28 Jul 2002 15:40:07 -0000 1.19
***************
*** 44,48 ****
#include <curses.h>
#endif
- #include <fcntl.h> /* O_RDONLY */
#include <ctype.h>
--- 44,47 ----
Index: exec.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/exec.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** exec.c 5 Jul 2001 16:47:04 -0000 1.7
--- exec.c 28 Jul 2002 15:40:07 -0000 1.8
***************
*** 128,132 ****
perror(msg); /* display the reason */
askforreturn(); /* wait until the user sees the message */
! exit(1); /* exit the child */
/* NOTREACHED */
}
--- 128,132 ----
perror(msg); /* display the reason */
askforreturn(); /* wait until the user sees the message */
! myexit(1); /* exit the child */
/* NOTREACHED */
}
Index: global.h
===================================================================
RCS file: /cvsroot/cscope/cscope/src/global.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** global.h 11 Jul 2002 14:23:45 -0000 1.21
--- global.h 28 Jul 2002 15:40:07 -0000 1.22
***************
*** 107,110 ****
--- 107,116 ----
#endif
+ /* HBB 20020728: if <fcntl.h> is there, #include it here, since that's
+ * where the system definitions of O_TEXT should be coming from */
+ #ifdef HAVE_FCNTL_H
+ # include <fcntl.h>
+ #endif
+
/* HBB 20020103: Need to force text or binary mode opens on Cygwins,
* because of their "binary/text mode mount" silliness :-( */
Index: logdir.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/logdir.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** logdir.c 5 Jul 2001 16:47:04 -0000 1.4
--- logdir.c 28 Jul 2002 15:40:07 -0000 1.5
***************
*** 42,46 ****
#include <unistd.h>
#include <string.h>
- #include <fcntl.h>
#include "global.h"
--- 42,45 ----
Index: main.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/main.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** main.c 10 Oct 2001 16:49:22 -0000 1.26
--- main.c 28 Jul 2002 15:40:07 -0000 1.27
***************
*** 49,53 ****
#include <curses.h>
#endif
- #include <fcntl.h> /* O_RDONLY */
#include <sys/types.h> /* needed by stat.h */
#include <sys/stat.h> /* stat */
--- 49,52 ----
***************
*** 152,156 ****
if (strlen(s) > PATLEN) {
(void) fprintf(stderr, "cscope: pattern too long, cannot be > %d characters\n", PATLEN);
! exit(1);
}
(void) strcpy(pattern, s);
--- 151,155 ----
if (strlen(s) > PATLEN) {
(void) fprintf(stderr, "cscope: pattern too long, cannot be > %d characters\n", PATLEN);
! myexit(1);
}
(void) strcpy(pattern, s);
***************
*** 169,173 ****
(void) fprintf(stderr, "%s: version %d%s\n", argv0,
FILEVERSION, FIXVERSION);
! exit(0);
#endif
case 'b': /* only build the cross-reference */
--- 168,172 ----
(void) fprintf(stderr, "%s: version %d%s\n", argv0,
FILEVERSION, FIXVERSION);
! myexit(0);
#endif
case 'b': /* only build the cross-reference */
***************
*** 190,194 ****
case 'h':
(void) longusage();
! exit(1);
case 'k': /* ignore DFLT_INCDIR */
kernelmode = YES;
--- 189,193 ----
case 'h':
(void) longusage();
! myexit(1);
case 'k': /* ignore DFLT_INCDIR */
kernelmode = YES;
***************
*** 289,293 ****
(void) usage();
(void) fprintf(stderr, "Try the -h option for more information.\n");
! exit(1);
}
}
--- 288,292 ----
(void) usage();
(void) fprintf(stderr, "Try the -h option for more information.\n");
! myexit(1);
}
}
***************
*** 309,313 ****
{
fprintf (stderr, "cscope: Must use -b if file list comes from stdin\n");
! exit(1);
}
--- 308,312 ----
{
fprintf (stderr, "cscope: Must use -b if file list comes from stdin\n");
! myexit(1);
}
***************
*** 317,321 ****
fprintf (stderr, "cscope: Temporary directory %s does not exist or cannot be accessed\n", tmpdir);
fprintf (stderr, "cscope: Please create the directory or set the environment variable\ncscope: TMPDIR to a valid directory\n");
! exit(1);
}
--- 316,320 ----
fprintf (stderr, "cscope: Temporary directory %s does not exist or cannot be accessed\n", tmpdir);
fprintf (stderr, "cscope: Please create the directory or set the environment variable\ncscope: TMPDIR to a valid directory\n");
! myexit(1);
}
***************
*** 481,485 ****
if (fscanf(oldrefs, "%s", path) != 1) {
posterr("cscope: cannot read source file name from file %s\n", reffile);
! exit(1);
}
srcfiles[i] = stralloc(path);
--- 480,484 ----
if (fscanf(oldrefs, "%s", path) != 1) {
posterr("cscope: cannot read source file name from file %s\n", reffile);
! myexit(1);
}
srcfiles[i] = stralloc(path);
***************
*** 722,731 ****
if (fscanf(oldrefs, "%d", &i) != 1) {
posterr("cscope: cannot read list size from file %s\n", reffile);
! exit(1);
}
while (--i >= 0) {
if (fscanf(oldrefs, "%*s") != 0) {
posterr("cscope: cannot read list name from file %s\n", reffile);
! exit(1);
}
}
--- 721,730 ----
if (fscanf(oldrefs, "%d", &i) != 1) {
posterr("cscope: cannot read list size from file %s\n", reffile);
! myexit(1);
}
while (--i >= 0) {
if (fscanf(oldrefs, "%*s") != 0) {
posterr("cscope: cannot read list name from file %s\n", reffile);
! myexit(1);
}
}
Index: mypopen.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/mypopen.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** mypopen.c 11 Jul 2002 14:23:45 -0000 1.9
--- mypopen.c 28 Jul 2002 15:40:07 -0000 1.10
***************
*** 33,37 ****
#include <stdio.h>
#include <signal.h>
- #include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
--- 33,36 ----
Index: vp.h
===================================================================
RCS file: /cvsroot/cscope/cscope/src/vp.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** vp.h 4 Jan 2002 12:11:50 -0000 1.4
--- vp.h 28 Jul 2002 15:40:07 -0000 1.5
***************
*** 45,49 ****
#define MAXPATH 200 /* max length for entire name */
! #include <fcntl.h>
#include <sys/stat.h>
--- 45,57 ----
#define MAXPATH 200 /* max length for entire name */
! #ifdef HAVE_CONFIG_H
! # include "config.h"
! #else
! # define HAVE_FCNTL_H 1 /* in case of doubt, assume it's there */
! #endif
! #ifdef HAVE_FCNTL_H
! # include <fcntl.h> /* needed for O_... open flags */
! #endif
!
#include <sys/stat.h>
Index: vpopen.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/vpopen.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** vpopen.c 3 May 2000 22:02:10 -0000 1.3
--- vpopen.c 28 Jul 2002 15:40:07 -0000 1.4
***************
*** 35,39 ****
#include <stdio.h>
- #include <fcntl.h>
#include "global.h"
#include "vp.h"
--- 35,38 ----
|