]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dev.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / stored / dev.c
index 7dc108cab7eb336bd7a42e8a4716c489d8b34879..b01c6703832aa9026432f799a4c7e6b40f39ad93 100644 (file)
@@ -359,25 +359,24 @@ void DEVICE::open_tape_device(DCR *dcr, int omode)
    /* Use system open() */
    while ((fd = ::open(dev_name, mode+nonblocking, MODE_RW)) < 0) {
       berrno be;
-      dev_errno = errno;
-      Dmsg5(050, "Open omode=%d mode=%x nonblock=%d error errno=%d ERR=%s\n", 
-           omode, mode, nonblocking, errno, be.strerror());
-      if (dev_errno == EINTR || dev_errno == EAGAIN) {
+      Dmsg2(100, "Open error errno=%d ERR=%s\n", errno, be.strerror());
+      if (errno == EINTR || errno == EAGAIN) {
          Dmsg0(100, "Continue open\n");
          continue;
       }
       /* Busy wait for specified time (default = 5 mins) */
-      if (dev_errno == EBUSY && timeout-- > 0) {
+      if (errno == EBUSY && timeout-- > 0) {
          Dmsg2(100, "Device %s busy. ERR=%s\n", print_name(), be.strerror());
          bmicrosleep(1, 0);
          continue;
       }
       /* IO error (no volume) try 10 times every 6 seconds */
-      if (dev_errno == EIO && ioerrcnt-- > 0) {
+      if (errno == EIO && ioerrcnt-- > 0) {
          bmicrosleep(5, 0);
          Dmsg0(100, "Continue open\n");
          continue;
       }
+      dev_errno = errno;
       Mmsg2(errmsg, _("Unable to open device %s: ERR=%s\n"),
             print_name(), be.strerror(dev_errno));
       /* Stop any open timer we set */