summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-22 16:10:22 +1100
committerNeilBrown <neilb@suse.de>2011-03-22 16:10:22 +1100
commitd998b738f5b91e6058659b459e5b9e3717d085f6 (patch)
tree18a7e8eeff84004a86e0c37753acc8da9dcfc9f0 /util.c
parent4e2c1a9a32c8e4c85bc699ff425a75bd5c594f8e (diff)
mdmon: don't wait for O_EXCL when shutting down.
If mdmon is shutting down because there are no devices left to look at, then don't wait 5 seconds for an O_EXCL open, and that can block progress of --grow. Only wait for O_EXCL if we received a signal. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/util.c b/util.c
index cc6ccb4d..8e1b7371 100644
--- a/util.c
+++ b/util.c
@@ -998,12 +998,17 @@ int dev_open(char *dev, int flags)
return fd;
}
-int open_dev(int devnum)
+int open_dev_flags(int devnum, int flags)
{
char buf[20];
sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum));
- return dev_open(buf, O_RDONLY);
+ return dev_open(buf, flags);
+}
+
+int open_dev(int devnum)
+{
+ return open_dev_flags(devnum, O_RDONLY);
}
int open_dev_excl(int devnum)