adb: win32: properly set EBADF in some functions.
Test: treehugger Change-Id: If3f29f9ee586e29652e9709b3f594a1376ed4bb3
This commit is contained in:
parent
64a63acba9
commit
011ba4b9bf
1 changed files with 4 additions and 0 deletions
|
@ -462,6 +462,7 @@ int adb_read(int fd, void* buf, int len) {
|
|||
FH f = _fh_from_int(fd, __func__);
|
||||
|
||||
if (f == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -472,6 +473,7 @@ int adb_write(int fd, const void* buf, int len) {
|
|||
FH f = _fh_from_int(fd, __func__);
|
||||
|
||||
if (f == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -493,6 +495,7 @@ int adb_lseek(int fd, int pos, int where) {
|
|||
FH f = _fh_from_int(fd, __func__);
|
||||
|
||||
if (!f) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -503,6 +506,7 @@ int adb_close(int fd) {
|
|||
FH f = _fh_from_int(fd, __func__);
|
||||
|
||||
if (!f) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue