parent
0e6e4abedc
commit
bf8ccfce18
@ -120,8 +120,7 @@ uv_handle_type uv_guess_handle(uv_file file) {
|
|||||||
struct stat s;
|
struct stat s;
|
||||||
|
|
||||||
if (file < 0) {
|
if (file < 0) {
|
||||||
uv__set_sys_error(NULL, EINVAL); /* XXX Need loop? */
|
return UV_UNKNOWN_HANDLE;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isatty(file)) {
|
if (isatty(file)) {
|
||||||
@ -129,8 +128,7 @@ uv_handle_type uv_guess_handle(uv_file file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fstat(file, &s)) {
|
if (fstat(file, &s)) {
|
||||||
uv__set_sys_error(NULL, errno); /* XXX Need loop? */
|
return UV_UNKNOWN_HANDLE;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!S_ISSOCK(s.st_mode) && !S_ISFIFO(s.st_mode)) {
|
if (!S_ISSOCK(s.st_mode) && !S_ISFIFO(s.st_mode)) {
|
||||||
|
|||||||
@ -27,6 +27,8 @@ TEST_IMPL(tty) {
|
|||||||
uv_tty_t tty;
|
uv_tty_t tty;
|
||||||
uv_loop_t* loop = uv_default_loop();
|
uv_loop_t* loop = uv_default_loop();
|
||||||
|
|
||||||
|
ASSERT(UV_UNKNOWN_HANDLE == uv_guess_handle(-1));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not necessarily a problem if this assert goes off. E.G you are piping
|
* Not necessarily a problem if this assert goes off. E.G you are piping
|
||||||
* this test to a file. 0 == stdin.
|
* this test to a file. 0 == stdin.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user