aboutsummaryrefslogtreecommitdiffstats
path: root/unwind_prot.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>1996-12-23 17:02:34 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:49 +0000
commitccc6cda312fea9f0468ee65b8f368e9653e1380b (patch)
treeb059878adcfd876c4acb8030deda1eeb918c7e75 /unwind_prot.c
parent726f63884db0132f01745f1fb4465e6621088ccf (diff)
downloadandroid_external_bash-ccc6cda312fea9f0468ee65b8f368e9653e1380b.tar.gz
android_external_bash-ccc6cda312fea9f0468ee65b8f368e9653e1380b.tar.bz2
android_external_bash-ccc6cda312fea9f0468ee65b8f368e9653e1380b.zip
Imported from ../bash-2.0.tar.gz.
Diffstat (limited to 'unwind_prot.c')
-rw-r--r--unwind_prot.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/unwind_prot.c b/unwind_prot.c
index d9399d7..dac5e04 100644
--- a/unwind_prot.c
+++ b/unwind_prot.c
@@ -24,13 +24,18 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Unwind Protection Scheme for Bash */
/* */
/* **************************************************************** */
-#include "bashtypes.h"
-#include <signal.h>
#include "config.h"
+
+#include "bashtypes.h"
+#if defined (HAVE_UNISTD_H)
+# include <unistd.h>
+#endif
+
#include "command.h"
#include "general.h"
#include "unwind_prot.h"
#include "quit.h"
+#include "sig.h"
/* If CLEANUP is null, then ARG contains a tag to throw back to. */
typedef struct _uwp {
@@ -235,7 +240,7 @@ static void
restore_variable (sv)
SAVED_VAR *sv;
{
- if (sv->size > sizeof (int))
+ if (sv->size != sizeof (int))
{
bcopy ((char *)sv->desired_setting, (char *)sv->variable, sv->size);
free (sv->desired_setting);
@@ -260,7 +265,7 @@ unwind_protect_var (var, value, size)
SAVED_VAR *s = (SAVED_VAR *)xmalloc (sizeof (SAVED_VAR));
s->variable = var;
- if (size > sizeof (int))
+ if (size != sizeof (int))
{
s->desired_setting = (char *)xmalloc (size);
bcopy (value, (char *)s->desired_setting, size);