[PATCH v13 08/10] usbip: exporting devices: change to usbip_list.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correction to wording inconsistency around import and export in 
usbip_list.c regarding output title, help and function names.

'exported' was used for devices bound in remote and to be attached with 
'import' request. This patch set uses pre-defined 'export' request to 
connect device.

To avoid mixed usage of 'export', 'importable' is used for devices to 
be attached with 'import' request.

The word 'imported' has already been used in output of port operation. 
It is consistent to this patch.

Signed-off-by: Nobuo Iwata <nobuo.iwata@xxxxxxxxxxxxxxx>
---
 tools/usb/usbip/src/usbip_list.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/usb/usbip/src/usbip_list.c b/tools/usb/usbip/src/usbip_list.c
index f1b38e8..cf69f31 100644
--- a/tools/usb/usbip/src/usbip_list.c
+++ b/tools/usb/usbip/src/usbip_list.c
@@ -44,7 +44,7 @@
 static const char usbip_list_usage_string[] =
 	"usbip list [-p|--parsable] <args>\n"
 	"    -p, --parsable         Parsable list format\n"
-	"    -r, --remote=<host>    List the exportable USB devices on <host>\n"
+	"    -r, --remote=<host>    List the importable USB devices on <host>\n"
 	"    -l, --local            List the local USB devices\n";
 
 void usbip_list_usage(void)
@@ -52,7 +52,7 @@ void usbip_list_usage(void)
 	printf("usage: %s", usbip_list_usage_string);
 }
 
-static int get_exported_devices(char *host, int sockfd)
+static int get_importable_devices(char *host, int sockfd)
 {
 	char product_name[100];
 	char class_name[100];
@@ -82,14 +82,14 @@ static int get_exported_devices(char *host, int sockfd)
 		return -1;
 	}
 	PACK_OP_DEVLIST_REPLY(0, &reply);
-	dbg("exportable devices: %d\n", reply.ndev);
+	dbg("importable devices: %d\n", reply.ndev);
 
 	if (reply.ndev == 0) {
-		info("no exportable devices found on %s", host);
+		info("no importable devices found on %s", host);
 		return 0;
 	}
 
-	printf("Exportable USB devices\n");
+	printf("Importable USB devices\n");
 	printf("======================\n");
 	printf(" - %s\n", host);
 
@@ -134,7 +134,7 @@ static int get_exported_devices(char *host, int sockfd)
 	return 0;
 }
 
-static int list_exported_devices(char *host)
+static int list_importable_devices(char *host)
 {
 	int rc;
 	int sockfd;
@@ -147,9 +147,10 @@ static int list_exported_devices(char *host)
 	}
 	dbg("connected to %s:%s", host, usbip_port_string);
 
-	rc = get_exported_devices(host, sockfd);
+	rc = get_importable_devices(host, sockfd);
 	if (rc < 0) {
 		err("failed to get device list from %s", host);
+		close(sockfd);
 		return -1;
 	}
 
@@ -351,7 +352,7 @@ int usbip_list(int argc, char *argv[])
 			parsable = true;
 			break;
 		case 'r':
-			ret = list_exported_devices(optarg);
+			ret = list_importable_devices(optarg);
 			goto out;
 		case 'l':
 			ret = list_devices(parsable);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux