-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
staging: usbip: userspace: migrate usbip_bind to libudev
This patch adds autoconf check for libudev and migrates usbip_bind to the new library. libsysfs will still be used until all userspace is modified. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Loading branch information
Valentina Manea
authored and
Greg Kroah-Hartman
committed
Mar 9, 2014
1 parent
0669e5f
commit 1e94031
Showing
7 changed files
with
127 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
|
||
#include "sysfs_utils.h" | ||
#include "usbip_common.h" | ||
|
||
int write_sysfs_attribute(const char *attr_path, const char *new_value, | ||
size_t len) | ||
{ | ||
int fd; | ||
int length; | ||
|
||
fd = open(attr_path, O_WRONLY); | ||
if (fd < 0) { | ||
dbg("error opening attribute %s", attr_path); | ||
return -1; | ||
} | ||
|
||
length = write(fd, new_value, len); | ||
if (length < 0) { | ||
dbg("error writing to attribute %s", attr_path); | ||
close(fd); | ||
return -1; | ||
} | ||
|
||
close(fd); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
#ifndef __SYSFS_UTILS_H | ||
#define __SYSFS_UTILS_H | ||
|
||
int write_sysfs_attribute(const char *attr_path, const char *new_value, | ||
size_t len); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters