summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1999-06-05 13:27:54 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1999-06-05 13:27:54 +0000
commitc1b5a833e6651deaf7bdd5868dbc1600aade118e (patch)
treef84d9c1b547888c0328e63cffdd498ef83170941 /otherlibs/unix
parent51c55b222826b2251c358ce73f2262972ce0cf48 (diff)
Ne pas oublier de passer en mode 'blocking section'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2378 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix')
-rw-r--r--otherlibs/unix/signals.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/otherlibs/unix/signals.c b/otherlibs/unix/signals.c
index 6edff9042..ecb1a133e 100644
--- a/otherlibs/unix/signals.c
+++ b/otherlibs/unix/signals.c
@@ -55,10 +55,14 @@ value unix_sigprocmask(value vaction, value vset) /* ML */
{
int how;
sigset_t set, oldset;
+ int retcode;
how = sigprocmask_cmd[Int_val(vaction)];
decode_sigset(vset, &set);
- if (sigprocmask(how, &set, &oldset) == -1) uerror("sigprocmask", Nothing);
+ enter_blocking_section();
+ retcode = sigprocmask(how, &set, &oldset);
+ leave_blocking_section();
+ if (retcode == -1) uerror("sigprocmask", Nothing);
return encode_sigset(&oldset);
}
@@ -72,8 +76,12 @@ value unix_sigpending(value unit) /* ML */
value unix_sigsuspend(value vset) /* ML */
{
sigset_t set;
+ int retcode;
decode_sigset(vset, &set);
- if (sigsuspend(&set) == -1 && errno != EINTR) uerror("sigsuspend", Nothing);
+ enter_blocking_section();
+ retcode = sigsuspend(&set);
+ leave_blocking_section();
+ if (retcode == -1 && errno != EINTR) uerror("sigsuspend", Nothing);
return Val_unit;
}