diff options
Diffstat (limited to 'mount/mount.c')
-rw-r--r-- | mount/mount.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mount/mount.c b/mount/mount.c index 39a9bd85..be051355 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1071,6 +1071,7 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, int loop = 0; const char *loopdev = 0, *loopfile = 0; struct stat statbuf; + int retries = 0; /* Nr of retries for mount in case of ENOMEDIUM */ /* copies for freeing on exit */ const char *opts1, *spec1, *node1, *types1, *extra_opts1; @@ -1133,6 +1134,7 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, goto out; } +mount_retry: block_signals (SIG_BLOCK); if (!fake) { @@ -1362,6 +1364,17 @@ try_mount_one (const char *spec0, const char *node0, const char *types0, } break; } + case ENOMEDIUM: + if (retries < CRDOM_NOMEDIUM_RETRIES) { + if (verbose) + printf(_("mount: no medium found on %s ...trying again\n"), + spec); + sleep(3); + ++retries; + goto mount_retry; + } + error(_("mount: no medium found on %s"), spec); + break; default: error ("mount: %s", strerror (mnt_err)); break; } |