summaryrefslogtreecommitdiff
path: root/src/mount
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-08-21 11:00:33 -0700
committerSage Weil <sage@newdream.net>2009-08-21 11:00:33 -0700
commitf9ec9d4a762c9732b8086333aad07c1c307b57e1 (patch)
treeb84e73f50d524e260f1c809fd77e432bf7024b29 /src/mount
parent5822c6a2c2954f34fca059bf90dd8c001c5a0835 (diff)
downloadceph-f9ec9d4a762c9732b8086333aad07c1c307b57e1.tar.gz
mount.ceph: block same signals as /sbin/mount
Diffstat (limited to 'src/mount')
-rw-r--r--src/mount/mount.ceph.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c
index 491970f1cae..3a811c044a9 100644
--- a/src/mount/mount.ceph.c
+++ b/src/mount/mount.ceph.c
@@ -11,6 +11,17 @@ int verboseflag = 0;
#include "mtab.c"
+void
+block_signals (int how) {
+ sigset_t sigs;
+
+ sigfillset (&sigs);
+ sigdelset(&sigs, SIGTRAP);
+ sigdelset(&sigs, SIGSEGV);
+ sigprocmask (how, &sigs, (sigset_t *) 0);
+}
+
+
static int safe_cat(char **pstr, int *plen, int pos, const char *str2)
{
int len2 = strlen(str2);
@@ -259,6 +270,8 @@ int main(int argc, char *argv[])
parse_options(&new_argv[options_pos], &flags);
+ block_signals(SIG_BLOCK);
+
if (mount(new_argv[1], new_argv[2], "ceph", flags, new_argv[options_pos])) {
switch (errno) {
case ENODEV:
@@ -271,6 +284,8 @@ int main(int argc, char *argv[])
update_mtab_entry(new_argv[1], new_argv[2], "ceph", new_argv[options_pos], flags, 0, 0);
}
+ block_signals(SIG_UNBLOCK);
+
free(new_argv);
exit(0);
}