From c626a26c1f74a5dca2e28220b95108fca7231a8e Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Tue, 29 Mar 2016 17:34:46 +0200 Subject: [PATCH] Remove doublets of Emsg and Dmsg Emsg now automtatically does Dmsg, so we would then get double output. --- src/lib/bsys.c | 1 - src/lib/crypto_cache.c | 1 - src/lib/scsi_lli.c | 35 ------------------- src/plugins/stored/scsicrypto-sd.c | 7 ++-- src/stored/backends/unix_file_device.c | 1 - src/win32/stored/backends/win32_file_device.c | 2 +- 6 files changed, 4 insertions(+), 43 deletions(-) diff --git a/src/lib/bsys.c b/src/lib/bsys.c index 9b38b1dcf72..ae0b7f76dcb 100644 --- a/src/lib/bsys.c +++ b/src/lib/bsys.c @@ -746,7 +746,6 @@ void write_state_file(char *dir, const char *progname, int port) secure_erase(NULL, fname); if ((sfd = open(fname, O_CREAT|O_WRONLY|O_BINARY, 0640)) < 0) { berrno be; - Dmsg2(000, "Could not create state file. %s ERR=%s\n", fname, be.bstrerror()); Emsg2(M_ERROR, 0, _("Could not create state file. %s ERR=%s\n"), fname, be.bstrerror()); goto bail_out; } diff --git a/src/lib/crypto_cache.c b/src/lib/crypto_cache.c index 9ed57b128ea..8082c7946c0 100644 --- a/src/lib/crypto_cache.c +++ b/src/lib/crypto_cache.c @@ -156,7 +156,6 @@ void write_crypto_cache(const char *cache_file) if ((fd = open(cache_file, O_CREAT | O_WRONLY | O_BINARY, 0640)) < 0) { berrno be; - Dmsg2(000, "Could not create crypto cache file. %s ERR=%s\n", cache_file, be.bstrerror()); Emsg2(M_ERROR, 0, _("Could not create crypto cache file. %s ERR=%s\n"), cache_file, be.bstrerror()); goto bail_out; } diff --git a/src/lib/scsi_lli.c b/src/lib/scsi_lli.c index 04afe19fac2..e09eceb838b 100644 --- a/src/lib/scsi_lli.c +++ b/src/lib/scsi_lli.c @@ -67,8 +67,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to open %s: ERR=%s\n"), device_name, be.bstrerror()); - Dmsg2(010, "Failed to open %s: ERR=%s\n", - device_name, be.bstrerror()); return false; } opened_device = true; @@ -91,8 +89,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Unable to perform SG_IO ioctl on fd %d: ERR=%s\n"), fd, be.bstrerror()); - Dmsg2(010, "Unable to perform SG_IO ioctl on fd %d: ERR=%s\n", - fd, be.bstrerror()); goto bail_out; } @@ -101,10 +97,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, io_hdr.info, io_hdr.masked_status, io_hdr.msg_status); Emsg2(M_ERROR, 0, _(" host status 0x%02x driver status 0x%02x\n"), io_hdr.host_status, io_hdr.driver_status ); - Dmsg3(010, "Failed with info 0x%02x mask status 0x%02x msg status 0x%02x\n", - io_hdr.info, io_hdr.masked_status, io_hdr.msg_status); - Dmsg2(010, " host status 0x%02x driver status 0x%02x\n", - io_hdr.host_status, io_hdr.driver_status ); goto bail_out; } @@ -193,8 +185,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to open %s: ERR=%s\n"), device_name, be.bstrerror()); - Dmsg2(010, "Failed to open %s: ERR=%s\n", - device_name, be.bstrerror()); return false; } opened_device = true; @@ -219,10 +209,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, fd, be.bstrerror()); Emsg3(M_ERROR, 0, _("Sense Key: %0.2X ASC: %0.2X ASCQ: %0.2X\n"), LOBYTE(sense.senseKey), sense.addSenseCode, sense.addSenseCodeQual); - Dmsg2(010, "Unable to perform USCSICMD ioctl on fd %d: ERR=%s\n", - fd, be.bstrerror()); - Dmsg3(010, "Sense Key: %0.2X ASC: %0.2X ASCQ: %0.2X\n", - LOBYTE(sense.senseKey), sense.addSenseCode, sense.addSenseCodeQual); goto bail_out; } @@ -302,8 +288,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to find CAM device for %s: ERR=%s\n"), device_name, be.bstrerror()); - Dmsg2(010, "Failed to find CAM device for %s: ERR=%s\n", - device_name, be.bstrerror()); return false; } @@ -313,8 +297,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to open CAM device for %s: ERR=%s\n"), device_name, be.bstrerror()); - Dmsg2(010, "Failed to open CAM device for %s: ERR=%s\n", - device_name, be.bstrerror()); return false; } @@ -322,8 +304,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, if (!ccb) { Emsg1(M_ERROR, 0, _("Failed to allocate new ccb for %s\n"), device_name); - Dmsg1(0, "Failed to allocate new ccb for %s\n", - device_name); goto bail_out; } @@ -348,9 +328,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to send ccb to device %s: %s\n"), device_name, cam_error_string(cam_dev, ccb, errbuf, sizeof(errbuf), CAM_ESF_ALL, CAM_EPF_ALL)); - Dmsg2(010, "Failed to send ccb to device %s: %s\n", - device_name, cam_error_string(cam_dev, ccb, errbuf, sizeof(errbuf), - CAM_ESF_ALL, CAM_EPF_ALL)); cam_freeccb(ccb); goto bail_out; } @@ -440,8 +417,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Failed to open %s: ERR=%s\n"), device_name, be.bstrerror()); - Dmsg2(010, "Failed to open %s: ERR=%s\n", - device_name, be.bstrerror()); return false; } opened_device = true; @@ -463,8 +438,6 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, Emsg2(M_ERROR, 0, _("Unable to perform SCIOCCOMMAND ioctl on fd %d: ERR=%s\n"), fd, be.bstrerror()); - Dmsg2(010, "Unable to perform SCIOCCOMMAND ioctl on fd %d: ERR=%s\n", - fd, be.bstrerror()); goto bail_out; } @@ -476,28 +449,20 @@ static inline bool do_scsi_cmd_page(int fd, const char *device_name, sense = req.sense; Emsg3(M_ERROR, 0, _("Sense Key: %0.2X ASC: %0.2X ASCQ: %0.2X\n"), LOBYTE(sense.senseKey), sense.addSenseCode, sense.addSenseCodeQual); - Dmsg3(010, "Sense Key: %0.2X ASC: %0.2X ASCQ: %0.2X\n", - LOBYTE(sense.senseKey), sense.addSenseCode, sense.addSenseCodeQual); break; case SCCMD_TIMEOUT: Emsg1(M_ERROR, 0, _("SCIOCCOMMAND ioctl on %s returned SCSI command timed out\n"), devicename); - Dmsg1(010, "SCIOCCOMMAND ioctl on %s returned SCSI command timed out\n", - devicename); break; case SCCMD_BUSY: Emsg1(M_ERROR, 0, _("SCIOCCOMMAND ioctl on %s returned device is busy\n"), devicename); - Dmsg1(010, "SCIOCCOMMAND ioctl on %s returned device is busy\n", - devicename); break; case SCCMD_SENSE: break; default: Emsg2(M_ERROR, 0, _("SCIOCCOMMAND ioctl on %s returned unknown status %d\n"), device_name, req.retsts); - Dmsg2(010, "SCIOCCOMMAND ioctl on %s returned unknown status %d\n", - device_name, req.retsts); break; } diff --git a/src/plugins/stored/scsicrypto-sd.c b/src/plugins/stored/scsicrypto-sd.c index dfa7f9f312b..8bd9c135804 100644 --- a/src/plugins/stored/scsicrypto-sd.c +++ b/src/plugins/stored/scsicrypto-sd.c @@ -386,10 +386,9 @@ static bRC do_set_scsi_encryption_key(void *value) DEFAULT_PASSPHRASE_LENGTH / 8, (unsigned char *)WrappedVolEncrKey, (unsigned char *)VolEncrKey) != 0) { - Dmsg1(dbglvl, - "scsicrypto-sd: Failed to unwrap encryption key using %s\n", director->keyencrkey.value); - Emsg0(M_ERROR, 0, - _("scsicrypto-sd: Failed to unwrap encryption key, probably wrong KeyEncryptionKey in config\n")); + Emsg1(M_ERROR, 0, + "scsicrypto-sd: Failed to unwrap encryption key using %s, probably wrong KeyEncryptionKey in config\n", + director->keyencrkey.value); return bRC_Error; } } diff --git a/src/stored/backends/unix_file_device.c b/src/stored/backends/unix_file_device.c index 5dab58eb2ab..43190802698 100644 --- a/src/stored/backends/unix_file_device.c +++ b/src/stored/backends/unix_file_device.c @@ -285,7 +285,6 @@ bool unix_file_device::d_truncate(DCR *dcr) dev_errno = errno; Mmsg2(errmsg, _("Could not reopen: %s, ERR=%s\n"), archive_name.c_str(), be.bstrerror()); - Dmsg1(100, "reopen failed: %s", errmsg); Emsg0(M_FATAL, 0, errmsg); return false; diff --git a/src/win32/stored/backends/win32_file_device.c b/src/win32/stored/backends/win32_file_device.c index cd97c3b93dd..a7e78adc37e 100644 --- a/src/win32/stored/backends/win32_file_device.c +++ b/src/win32/stored/backends/win32_file_device.c @@ -270,8 +270,8 @@ bool win32_file_device::d_truncate(DCR *dcr) dev_errno = errno; Mmsg2(errmsg, _("Could not reopen: %s, ERR=%s\n"), archive_name.c_str(), be.bstrerror()); - Dmsg1(100, "reopen failed: %s", errmsg); Emsg0(M_FATAL, 0, errmsg); + return false; }