diff --git a/basic/fdbuf.cpp b/basic/fdbuf.cpp index ad7865d..3ff2a72 100644 --- a/basic/fdbuf.cpp +++ b/basic/fdbuf.cpp @@ -34,7 +34,7 @@ fdbuf::fdbuf(int fd, int putback) fdbuf::~fdbuf() { - sync(); + fdbuf::sync(); ::close(mFd); } diff --git a/sanecpp/sanecpp.cpp b/sanecpp/sanecpp.cpp index f3cf4c0..08dd0de 100644 --- a/sanecpp/sanecpp.cpp +++ b/sanecpp/sanecpp.cpp @@ -564,8 +564,6 @@ session::~session() session& session::start() { - log << "sane_start(" << m_device.get() << ") with options:" << m_options - << std::endl; m_status = ::sane_start(m_device.get()); switch (m_status) { case SANE_STATUS_GOOD: @@ -610,6 +608,14 @@ session::read(std::vector& buffer) return *this; } +const session& +session::dump_options() const +{ + log << "session " << m_device.get() << " options:" << m_options + << std::endl; + return *this; +} + void session::init() { diff --git a/sanecpp/sanecpp.h b/sanecpp/sanecpp.h index 775ee31..58be1a9 100644 --- a/sanecpp/sanecpp.h +++ b/sanecpp/sanecpp.h @@ -170,6 +170,7 @@ class session session& start(); session& cancel(); session& read(std::vector&); + const session& dump_options() const; private: void init(); diff --git a/server/scanjob.cpp b/server/scanjob.cpp index 72ab331..5c4b06a 100644 --- a/server/scanjob.cpp +++ b/server/scanjob.cpp @@ -572,10 +572,12 @@ ScanJob::Private::beginTransfer() if(!atomicTransition(pending, processing)) return false; bool ok = true; - if (!mpSession) + if (!mpSession) { ok = (openSession() == SANE_STATUS_GOOD); - if (ok) - startSession(); + if (ok) + mpSession->dump_options(); + } + startSession(); ok = isProcessing(); if (!ok) closeSession();