Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353887
b: refs/heads/master
c: 82692d2
h: refs/heads/master
i:
  353885: 3221a78
  353883: 35d5f91
  353879: 241a2e5
  353871: 3b1ffb7
  353855: e866539
v: v3
  • Loading branch information
Ilija Hadzic authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 6839fde commit a8b8fd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 107fefd4dd56748878f1ffc44c321c29f6180748
refs/heads/master: 82692d202a199553a92d3c72cdd8959b497b9b62
15 changes: 13 additions & 2 deletions trunk/drivers/staging/usbip/userspace/src/usbip_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <fcntl.h>
#include <getopt.h>
#include <unistd.h>
#include <errno.h>

#include "vhci_driver.h"
#include "usbip_common.h"
Expand All @@ -52,8 +53,18 @@ static int record_connection(char *host, char *port, char *busid, int rhport)
int ret;

ret = mkdir(VHCI_STATE_PATH, 0700);
if (ret < 0)
return -1;
if (ret < 0) {
/* if VHCI_STATE_PATH exists, then it better be a directory */
if (errno == EEXIST) {
struct stat s;
ret = stat(VHCI_STATE_PATH, &s);
if (ret < 0)
return -1;
if (!(s.st_mode & S_IFDIR))
return -1;
} else
return -1;
}

snprintf(path, PATH_MAX, VHCI_STATE_PATH"/port%d", rhport);

Expand Down

0 comments on commit a8b8fd5

Please sign in to comment.