Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337976
b: refs/heads/master
c: a6bb875
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Yang authored and Greg Kroah-Hartman committed Nov 16, 2012
1 parent 7431e56 commit c579d80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a38e6fcf9173ffa8acf827c0b5d69863e012434
refs/heads/master: a6bb87522f42aea056585282a70de7512d297323
9 changes: 9 additions & 0 deletions trunk/drivers/staging/usbip/userspace/src/usbip_detach.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <sysfs/libsysfs.h>

#include <ctype.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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])) {
Expand All @@ -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");
Expand Down

0 comments on commit c579d80

Please sign in to comment.