[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [k3b/2.0] /: Upstream patches from NetBSD.
From:       Johannes Obermayr <johannesobermayr () gmx ! de>
Date:       2014-09-28 1:23:21
Message-ID: E1XY3Cr-00050S-GK () scm ! kde ! org
[Download RAW message or body]

Git commit 3b235cfde5152d89fa7f004e70799ee9df9f3e64 by Johannes Obermayr.
Committed on 28/09/2014 at 01:10.
Pushed by jobermayr into branch '2.0'.

Upstream patches from NetBSD.

http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/sysutils/k3b/patches/patch-libk3 \
bdevice_k3bscsicommand_netbsd.cpp?rev=1.1&content-type=text/plain&only_with_tag=MAIN \
http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/sysutils/k3b/patches/patch-libk3bdevice_k3bdevicemanager.cpp?rev=1.1&content-type=text/plain&only_with_tag=MAIN
 http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/sysutils/k3b/patches/patch-libk3bdevice_k3bdevice.cpp?rev=1.1&content-type=text/plain&only_with_tag=MAIN
 http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/sysutils/k3b/patches/patch-libk3b_tools_k3bcdparanoialib.cpp?rev=1.1&content-type=text/plain&only_with_tag=MAIN
 http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/sysutils/k3b/patches/patch-libk \
3b_jobs_k3bdatatrackreader.cpp?rev=1.1&content-type=text/plain&only_with_tag=MAIN

CC=markd@netbsd.org

M  +4    -0    libk3b/jobs/k3bdatatrackreader.cpp
M  +16   -5    libk3b/tools/k3bcdparanoialib.cpp
M  +13   -0    libk3bdevice/k3bdevice.cpp
M  +7    -0    libk3bdevice/k3bdevicemanager.cpp
M  +1    -1    libk3bdevice/k3bscsicommand_netbsd.cpp

http://commits.kde.org/k3b/3b235cfde5152d89fa7f004e70799ee9df9f3e64

diff --git a/libk3b/jobs/k3bdatatrackreader.cpp b/libk3b/jobs/k3bdatatrackreader.cpp
index bfbf122..7f96f6f 100644
--- a/libk3b/jobs/k3bdatatrackreader.cpp
+++ b/libk3b/jobs/k3bdatatrackreader.cpp
@@ -256,7 +256,11 @@ bool K3b::DataTrackReader::run()
     //
     d->device->setSpeed( 0xffff, 0xffff );
 
+#ifdef __NETBSD__
+    s_bufferSizeSectors = 31;
+#else
     s_bufferSizeSectors = 128;
+#endif
     unsigned char* buffer = new unsigned \
                char[d->usedSectorSize*s_bufferSizeSectors];
     while( s_bufferSizeSectors > 0 && read( buffer, d->firstSector.lba(), \
s_bufferSizeSectors ) < 0 ) {  kDebug() << "(K3b::DataTrackReader) determine max read \
                sectors: "
diff --git a/libk3b/tools/k3bcdparanoialib.cpp b/libk3b/tools/k3bcdparanoialib.cpp
index 73a6c0a..68e2284 100644
--- a/libk3b/tools/k3bcdparanoialib.cpp
+++ b/libk3b/tools/k3bcdparanoialib.cpp
@@ -69,6 +69,17 @@ typedef short int int16_t;
 #define LIBCDIO_PARANOIA "cdio_paranoia.dll"
 #else
 #define LIBCDIO_CDDA "libcdio_cdda.so"
+#ifdef __NETBSD__
+#define CDDA_LIBCDDA_INTERFACE "cdda/libcdda_interace.so"
+#define CDDA_LIBCDDA_PARANOIA "cdda/libcdda_paranoia.so"
+#define LIBCDDA_INTERFACE "libcdda_interface.so"
+#define LIBCDDA_PARANOIA "libcdda_paranoia.so"
+#define LIBCDIO_PARANOIA "libcdio_paranoia.so"
+#else
+#define CDDA_LIBCDDA_INTERFACE "cdda/libcdda_interace.so.0"
+#define CDDA_LIBCDDA_PARANOIA "cdda/libcdda_paranoia.so.0"
+#define LIBCDDA_INTERFACE "libcdda_interface.so.0"
+#define LIBCDDA_PARANOIA "libcdda_paranoia.so.0"
 #define LIBCDIO_PARANOIA "libcdio_paranoia.so.0"
 #endif
 
@@ -532,11 +543,11 @@ K3b::CdparanoiaLib* K3b::CdparanoiaLib::create()
     if( s_libInterface == 0 ) {
         s_haveLibCdio = false;
 #ifndef Q_OS_WIN32
-        s_libInterface = dlopen( "libcdda_interface.so.0", RTLD_NOW|RTLD_GLOBAL );
+        s_libInterface = dlopen( LIBCDDA_INTERFACE, RTLD_NOW|RTLD_GLOBAL );
 
         // try the redhat & Co. location
         if( s_libInterface == 0 )
-            s_libInterface = dlopen( "cdda/libcdda_interface.so.0", \
RTLD_NOW|RTLD_GLOBAL ); +            s_libInterface = dlopen( CDDA_LIBCDDA_INTERFACE, \
RTLD_NOW|RTLD_GLOBAL );  #endif
         // try the new cdio lib
         if( s_libInterface == 0 ) {
@@ -550,11 +561,11 @@ K3b::CdparanoiaLib* K3b::CdparanoiaLib::create()
         }
 
 #ifndef Q_OS_WIN32
-        s_libParanoia = dlopen( "libcdda_paranoia.so.0", RTLD_NOW );
+        s_libParanoia = dlopen( LIBCDDA_PARANOIA, RTLD_NOW );
 
         // try the redhat & Co. location
         if( s_libParanoia == 0 )
-            s_libParanoia = dlopen( "cdda/libcdda_paranoia.so.0", RTLD_NOW );
+            s_libParanoia = dlopen( CDDA_LIBCDDA_PARANOIA, RTLD_NOW );
 #endif
         // try the new cdio lib
         if( s_haveLibCdio && s_libParanoia == 0 )
@@ -736,7 +747,7 @@ char* K3b::CdparanoiaLib::read( int* statusCode, unsigned int* \
track, bool littl  
     if( d->currentSector != d->data->sector() ) {
         kDebug() << "(K3b::CdparanoiaLib) need to seek before read. Looks as if we \
                are reusing the paranoia instance.";
-        if( !d->data->paranoiaSeek( d->currentSector, SEEK_SET ) )
+        if( !d->data->paranoiaSeek( d->currentSector, SEEK_SET ) == -1 )
             return 0;
     }
 
diff --git a/libk3bdevice/k3bdevice.cpp b/libk3bdevice/k3bdevice.cpp
index 0ac7424..09b1a62 100644
--- a/libk3bdevice/k3bdevice.cpp
+++ b/libk3bdevice/k3bdevice.cpp
@@ -35,6 +35,9 @@
 #include <Solid/OpticalDrive>
 #include <Solid/Block>
 #include <Solid/StorageAccess>
+#ifdef __NETBSD__
+#include <Solid/GenericInterface>
+#endif
 
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -242,9 +245,19 @@ K3b::Device::Device::Handle K3b::Device::openDevice( const char* \
name, bool writ  
 K3b::Device::Device::Device( const Solid::Device& dev )
 {
+#ifdef __NETBSD__
+    const Solid::GenericInterace *gi = dev.as<Solid::GenericInterface>();
+#endif
     d = new Private;
     d->solidDevice = dev;
+#ifndef __NETBSD__
     d->blockDevice = dev.as<Solid::Block>()->device();
+#else
+    if (gi->propertyExists("block.netbsd.raw_device"))
+        d->blockDevice = gi->property("block.netbsd.raw_device").toString();
+    else
+        d->blockDevice = dev.as<Solid::Block>()->device();
+#endif
     d->writeModes = 0;
     d->maxWriteSpeed = 0;
     d->maxReadSpeed = 0;
diff --git a/libk3bdevice/k3bdevicemanager.cpp b/libk3bdevice/k3bdevicemanager.cpp
index a690bc5..dc84df6 100644
--- a/libk3bdevice/k3bdevicemanager.cpp
+++ b/libk3bdevice/k3bdevicemanager.cpp
@@ -39,6 +39,9 @@
 #include <Solid/OpticalDrive>
 #include <Solid/Block>
 #include <Solid/Device>
+#ifdef __NETBSD__
+#include <Solid/GenericInterface>
+#endif
 
 #include <iostream>
 #include <limits.h>
@@ -356,7 +359,11 @@ bool K3b::Device::DeviceManager::saveConfig( KConfigGroup c )
 K3b::Device::Device* K3b::Device::DeviceManager::addDevice( const Solid::Device& \
solidDevice )  {
     if( const Solid::Block* blockDevice = solidDevice.as<Solid::Block>() ) {
+#ifndef __NETBSD__
         if( !findDevice( blockDevice->device() ) )
+#else
+        if( !findDevice( \
solidDevice.as<Solid::GenericInterface>()->propertyExists("block.netbsd.raw_device") \
? solidDevice.as<Solid::GenericInterface>()->property("block.netbsd.raw_device").toString() \
: blockDevice->device() ) ); +#endif
             return addDevice( new K3b::Device::Device( solidDevice ) );
         else
             kDebug() << "(K3b::Device::DeviceManager) dev " << blockDevice->device() \
                << " already found";
diff --git a/libk3bdevice/k3bscsicommand_netbsd.cpp \
b/libk3bdevice/k3bscsicommand_netbsd.cpp index 979ccbc..42c23a0 100644
--- a/libk3bdevice/k3bscsicommand_netbsd.cpp
+++ b/libk3bdevice/k3bscsicommand_netbsd.cpp
@@ -53,7 +53,7 @@ int K3b::Device::ScsiCommand::transport( TransportDirection dir,
                                          size_t len )
 {
     bool needToClose = false;
-    int deviceHandler = -1;
+    int deviceHandle = -1;
     if( m_device ) {
         m_device->usageLock();
         if( !m_device->isOpen() ) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic