diff --git a/src/add-ons/kernel/drivers/disk/virtual/nbd/Jamfile b/src/add-ons/kernel/drivers/disk/virtual/nbd/Jamfile index 6f47650c7a..d8dc15c869 100644 --- a/src/add-ons/kernel/drivers/disk/virtual/nbd/Jamfile +++ b/src/add-ons/kernel/drivers/disk/virtual/nbd/Jamfile @@ -2,15 +2,16 @@ SubDir HAIKU_TOP src add-ons kernel drivers disk virtual nbd ; SetSubDirSupportedPlatformsBeOSCompatible ; -#if $(TARGET_PLATFORM) != haiku { -# # Needed for . Unfortunately we also get the other headers there, -# # that we don't really want. -# UsePublicHeaders drivers ; -#} - # not Haiku-specific, ksocket.h also works in BONE. UsePrivateHeaders drivers ; +if $(TARGET_PLATFORM) = haiku { + # lock.h wants debug.h and others. + #UsePrivateHeaders kernel ; + #UsePublicHeaders kernel ; + UsePrivateHeaders [ FDirName kernel ] ; +} + KernelAddon nbd : nbd.c ; diff --git a/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c b/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c index a3fd744387..ff3a64b9cc 100644 --- a/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c +++ b/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c @@ -9,10 +9,12 @@ * Maps a Network Block Device as virtual partitions. */ +#include #include #include -#include #include +#include +#include #include #include @@ -24,6 +26,12 @@ */ //#define MOUNT_KLUDGE + +/* names, ohh names... */ +#ifndef SHUT_RDWR +#define SHUT_RDWR SHUTDOWN_BOTH +#endif + /* locking support */ #ifdef __HAIKU__ #include @@ -388,7 +396,7 @@ status_t nbd_teardown(struct nbd_device *dev) { status_t err, ret; PRINT((DP ">%s()\n", __FUNCTION__)); - kshutdown(dev->sock, SHUTDOWN_BOTH); + kshutdown(dev->sock, SHUT_RDWR); kclosesocket(dev->sock); dev->sock = -1; err = wait_for_thread(dev->postoffice, &ret); @@ -784,7 +792,6 @@ init_driver (void) const driver_settings *settings = get_driver_settings(handle); driver_parameter *p = NULL; char keyname[10]; - char *v; sprintf(keyname, "%d", i); for (j = 0; j < settings->parameter_count; j++) if (!strcmp(settings->parameters[j].name, keyname)) @@ -824,7 +831,7 @@ uninit_driver (void) PRINT((DP ">%s()\n", __FUNCTION__)); for (i = 0; i < MAX_NBDS; i++) { free(nbd_name[i]); - err = benaphore_destroy(&nbd_devices[i].ben); + benaphore_destroy(&nbd_devices[i].ben); } err = ksocket_cleanup(); /* HACK */