summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@red-bean.com>1997-04-12 00:39:56 +0000
committerJim Blandy <jimb@red-bean.com>1997-04-12 00:39:56 +0000
commite67dc2bebc7f9c351706fd8b5b8137369d8381af (patch)
tree50e2154dfc1dfe9b6666c113b82772a3e30a01af
parentd7b8a21a81228d978a912b2412c34b3628635043 (diff)
downloadguile-e67dc2bebc7f9c351706fd8b5b8137369d8381af.tar.gz
* posix.c (scm_status_exit_val, scm_status_exit_val,
scm_status_term_sig, scm_status_stop_sig): Modified to work with Ultrix versions of WIFSTOPPED, etc., which assume that their arguments are lvalues (hmm).
-rw-r--r--libguile/posix.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/libguile/posix.c b/libguile/posix.c
index 6fa2d4b82..f2102f1bb 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -438,20 +438,31 @@ SCM
scm_status_exit_val (status)
SCM status;
{
+ int lstatus;
+
SCM_ASSERT (SCM_INUMP (status), status, SCM_ARG1,s_status_exit_val);
- if (WIFEXITED (SCM_INUM (status)))
- return (SCM_MAKINUM (WEXITSTATUS (SCM_INUM (status))));
+
+ /* On Ultrix, the WIF... macros assume their argument is an lvalue;
+ go figure. SCM_INUM does not yield an lvalue. */
+ lstatus = SCM_INUM (status);
+ if (WIFEXITED (lstatus))
+ return (SCM_MAKINUM (WEXITSTATUS (lstatus)));
else
return SCM_BOOL_F;
}
+
SCM_PROC (s_status_term_sig, "status:term-sig", 1, 0, 0, scm_status_term_sig);
SCM
scm_status_term_sig (status)
SCM status;
{
+ int lstatus;
+
SCM_ASSERT (SCM_INUMP (status), status, SCM_ARG1,s_status_term_sig);
- if (WIFSIGNALED (SCM_INUM (status)))
- return SCM_MAKINUM (WTERMSIG (SCM_INUM (status)));
+
+ lstatus = SCM_INUM (status);
+ if (WIFSIGNALED (lstatus))
+ return SCM_MAKINUM (WTERMSIG (lstatus));
else
return SCM_BOOL_F;
}
@@ -461,9 +472,13 @@ SCM
scm_status_stop_sig (status)
SCM status;
{
+ int lstatus;
+
SCM_ASSERT (SCM_INUMP (status), status, SCM_ARG1,s_status_stop_sig);
- if (WIFSTOPPED (SCM_INUM (status)))
- return SCM_MAKINUM (WSTOPSIG (SCM_INUM (status)));
+
+ lstatus = SCM_INUM (status);
+ if (WIFSTOPPED (lstatus))
+ return SCM_MAKINUM (WSTOPSIG (lstatus));
else
return SCM_BOOL_F;
}