From c579d802f4b0b5aad28812d4a5446db09c96a3be Mon Sep 17 00:00:00 2001 From: Harvey Yang Date: Thu, 15 Nov 2012 16:32:49 +0800 Subject: [PATCH] --- yaml --- r: 337976 b: refs/heads/master c: a6bb87522f42aea056585282a70de7512d297323 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/staging/usbip/userspace/src/usbip_detach.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e916cba1f384..ddb8650829ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2a38e6fcf9173ffa8acf827c0b5d69863e012434 +refs/heads/master: a6bb87522f42aea056585282a70de7512d297323 diff --git a/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c b/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c index 89bf3c195c28..dac5f065755a 100644 --- a/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c +++ b/trunk/drivers/staging/usbip/userspace/src/usbip_detach.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,7 @@ static int detach_port(char *port) { int ret; uint8_t portnum; + char path[PATH_MAX+1]; for (unsigned int i=0; i < strlen(port); i++) if (!isdigit(port[i])) { @@ -57,6 +59,13 @@ static int detach_port(char *port) portnum = atoi(port); + /* remove the port state file */ + + snprintf(path, PATH_MAX, VHCI_STATE_PATH"/port%d", portnum); + + remove(path); + rmdir(VHCI_STATE_PATH); + ret = usbip_vhci_driver_open(); if (ret < 0) { err("open vhci_driver");