aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-03-16 15:58:41 +0000
committerMark Mitchell <mark@codesourcery.com>2005-03-16 15:58:41 +0000
commit9b265ec209d7dd38bd411cdd3bac4d705a244398 (patch)
tree9688b1dc3fbaaeb3353daade8bddf9ac448bd583 /gdb
parenta5324a3e50c3f59e7d547aec300819c07b026979 (diff)
downloadgdb-9b265ec209d7dd38bd411cdd3bac4d705a244398.zip
gdb-9b265ec209d7dd38bd411cdd3bac4d705a244398.tar.gz
gdb-9b265ec209d7dd38bd411cdd3bac4d705a244398.tar.bz2
* utils.c (internal_vproblem): Guard call to fork with
HAVE_WORKING_FORK. * cli/cli-cmds.c (shell_escape): Guard call to vfork with HAVE_WORKING_VFORK and HAVE_WORKING_FORK. * remote-fileo.c (remote_fileio_mode_to_host): Accomodate lack of S_IRGRP and related macros. (remote_fileio_mode_to_target): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/cli/cli-cmds.c5
-rw-r--r--gdb/remote-fileio.c22
-rw-r--r--gdb/utils.c2
4 files changed, 37 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 07d7fb8..fc9f632 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2005-03-15 Mark Mitchell <mark@codesourcery.com>
+
+ * utils.c (internal_vproblem): Guard call to fork with
+ HAVE_WORKING_FORK.
+ * cli/cli-cmds.c (shell_escape): Guard call to vfork with
+ HAVE_WORKING_VFORK and HAVE_WORKING_FORK.
+
+ * remote-fileo.c (remote_fileio_mode_to_host): Accomodate lack of
+ S_IRGRP and related macros.
+ (remote_fileio_mode_to_target): Likewise.
+
2005-03-14 Ben Elliston <bje@au.ibm.com>
* Makefile.in (CLIBS): Link libbfd after libopcodes, as it is a
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 49da474..3c091fe 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1,6 +1,6 @@
/* GDB CLI commands.
- Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -484,7 +484,8 @@ echo_command (char *text, int from_tty)
static void
shell_escape (char *arg, int from_tty)
{
-#ifdef CANT_FORK
+#if defined(CANT_FORK) || \
+ (!defined(HAVE_WORKING_VFORK) && !defined(HAVE_WORKING_FORK))
/* If ARG is NULL, they want an inferior shell, but `system' just
reports if the shell is available when passed a NULL arg. */
int rc = system (arg ? arg : "");
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index d2090e6..7d8744d 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -1,6 +1,6 @@
/* Remote File-I/O communications
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -162,18 +162,28 @@ remote_fileio_mode_to_host (long mode, int open_call)
hmode |= S_IWUSR;
if (mode & FILEIO_S_IXUSR)
hmode |= S_IXUSR;
+#ifdef S_IRGRP
if (mode & FILEIO_S_IRGRP)
hmode |= S_IRGRP;
+#endif
+#ifdef S_IWGRP
if (mode & FILEIO_S_IWGRP)
hmode |= S_IWGRP;
+#endif
+#ifdef S_IXGRP
if (mode & FILEIO_S_IXGRP)
hmode |= S_IXGRP;
+#endif
if (mode & FILEIO_S_IROTH)
hmode |= S_IROTH;
+#ifdef S_IWOTH
if (mode & FILEIO_S_IWOTH)
hmode |= S_IWOTH;
+#endif
+#ifdef S_IXOTH
if (mode & FILEIO_S_IXOTH)
hmode |= S_IXOTH;
+#endif
return hmode;
}
@@ -194,18 +204,28 @@ remote_fileio_mode_to_target (mode_t mode)
tmode |= FILEIO_S_IWUSR;
if (mode & S_IXUSR)
tmode |= FILEIO_S_IXUSR;
+#ifdef S_IRGRP
if (mode & S_IRGRP)
tmode |= FILEIO_S_IRGRP;
+#endif
+#ifdef S_IWRGRP
if (mode & S_IWGRP)
tmode |= FILEIO_S_IWGRP;
+#endif
+#ifdef S_IXGRP
if (mode & S_IXGRP)
tmode |= FILEIO_S_IXGRP;
+#endif
if (mode & S_IROTH)
tmode |= FILEIO_S_IROTH;
+#ifdef S_IWOTH
if (mode & S_IWOTH)
tmode |= FILEIO_S_IWOTH;
+#endif
+#ifdef S_IXOTH
if (mode & S_IXOTH)
tmode |= FILEIO_S_IXOTH;
+#endif
return tmode;
}
diff --git a/gdb/utils.c b/gdb/utils.c
index 690158b..7ee2061 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -789,8 +789,10 @@ further debugging may prove unreliable.", file, line, problem->name, msg);
{
if (dump_core_p)
{
+#ifdef HAVE_WORKING_FORK
if (fork () == 0)
abort (); /* NOTE: GDB has only three calls to abort(). */
+#endif
}
}