diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-02-01 15:11:47 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-02-01 15:11:47 +0000 |
commit | e8309efda5499f88eb950ff652acdd3a6b07d678 (patch) | |
tree | f1799405b3d3a841422f773c89c9d45538d83392 /winsup/cygwin/fhandler_socket.cc | |
parent | d93998b17a4c7f07925ecdd48a9474864ba47aea (diff) | |
download | cygnal-e8309efda5499f88eb950ff652acdd3a6b07d678.tar.gz cygnal-e8309efda5499f88eb950ff652acdd3a6b07d678.tar.bz2 cygnal-e8309efda5499f88eb950ff652acdd3a6b07d678.zip |
* fhandler.cc (fhandler_base::get_proc_fd_name): Don't generate
"device:" entry.
* fhandler.h (fhandler_socket::open): New method.
(fhandler_pipe::open): New method.
* fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of
/proc/self.
* fhandler_process.cc (fhandler_process::exists): Return -2 in
case of symlinks, -3 for pipes and -4 for sockets.
(fhandler_process::fstat): Handle pipes and sockets.
(fhandler_process::open): Handle opening /proc/<pid>/fd.
(fhandler_process::fill_filebuf): Generate empty names for
non exisiting file descriptors.
* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always
generate "socket:[number]" strings as on Linux.
(fhandler_socket::open): New method.
(fhandler_socket::fstat): Always return socket type.
* path.cc (symlink_info::set): Remove unused second parameter.
(path_conv::check): Handle pipes and sockets in /proc.
Set correct device type for AF_LOCAL sockets.
* pinfo.cc (_pinfo::commune_recv): Generate empty names for
non exisiting file descriptors.
(_pinfo::fd): Ditto.
* pipe.cc (fhandler_pipe::open): New method.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index a7e52936e..4f5552662 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -149,13 +149,17 @@ fhandler_socket::~fhandler_socket () char *fhandler_socket::get_proc_fd_name (char *buf) { - if (get_sun_path ()) - __small_sprintf (buf, "%s", get_sun_path ()); - else - __small_sprintf (buf, "socket:[%d]", get_socket ()); + __small_sprintf (buf, "socket:[%d]", get_socket ()); return buf; } +int +fhandler_socket::open (int flags, mode_t mode) +{ + set_errno (ENXIO); + return 0; +} + void fhandler_socket::set_connect_secret () { @@ -385,20 +389,9 @@ fhandler_socket::fstat (struct __stat64 *buf) int res = fhandler_base::fstat (buf); if (!res) { - if (get_socket_type ()) /* fstat */ - { - buf->st_dev = 0; - buf->st_ino = (__ino64_t) ((DWORD) get_handle ()); - buf->st_mode = S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO; - } - else - { - path_conv spc ("/dev", PC_SYM_NOFOLLOW | PC_NULLEMPTY, NULL); - buf->st_dev = spc.volser (); - buf->st_ino = get_namehash (); - buf->st_mode &= ~S_IRWXO; - buf->st_rdev = (get_device () << 16) | get_unit (); - } + buf->st_dev = 0; + buf->st_ino = (__ino64_t) ((DWORD) get_handle ()); + buf->st_mode = S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO; } return res; } |