Cygwin: AF_LOCAL: fix identifing abstract sockets in FS-related functions

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-03-26 18:11:10 +02:00
parent cfe5d362fe
commit ee49870a7d
1 changed files with 6 additions and 6 deletions

View File

@ -639,7 +639,7 @@ fhandler_socket_local::fstat (struct stat *buf)
{ {
int res; int res;
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::fstat (buf); return fhandler_socket_wsock::fstat (buf);
res = fhandler_base::fstat_fs (buf); res = fhandler_base::fstat_fs (buf);
if (!res) if (!res)
@ -653,7 +653,7 @@ fhandler_socket_local::fstat (struct stat *buf)
int __reg2 int __reg2
fhandler_socket_local::fstatvfs (struct statvfs *sfs) fhandler_socket_local::fstatvfs (struct statvfs *sfs)
{ {
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::fstatvfs (sfs); return fhandler_socket_wsock::fstatvfs (sfs);
fhandler_disk_file fh (pc); fhandler_disk_file fh (pc);
fh.get_device () = FH_FS; fh.get_device () = FH_FS;
@ -663,7 +663,7 @@ fhandler_socket_local::fstatvfs (struct statvfs *sfs)
int int
fhandler_socket_local::fchmod (mode_t newmode) fhandler_socket_local::fchmod (mode_t newmode)
{ {
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::fchmod (newmode); return fhandler_socket_wsock::fchmod (newmode);
fhandler_disk_file fh (pc); fhandler_disk_file fh (pc);
fh.get_device () = FH_FS; fh.get_device () = FH_FS;
@ -673,7 +673,7 @@ fhandler_socket_local::fchmod (mode_t newmode)
int int
fhandler_socket_local::fchown (uid_t uid, gid_t gid) fhandler_socket_local::fchown (uid_t uid, gid_t gid)
{ {
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::fchown (uid, gid); return fhandler_socket_wsock::fchown (uid, gid);
fhandler_disk_file fh (pc); fhandler_disk_file fh (pc);
return fh.fchown (uid, gid); return fh.fchown (uid, gid);
@ -682,7 +682,7 @@ fhandler_socket_local::fchown (uid_t uid, gid_t gid)
int int
fhandler_socket_local::facl (int cmd, int nentries, aclent_t *aclbufp) fhandler_socket_local::facl (int cmd, int nentries, aclent_t *aclbufp)
{ {
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::facl (cmd, nentries, aclbufp); return fhandler_socket_wsock::facl (cmd, nentries, aclbufp);
fhandler_disk_file fh (pc); fhandler_disk_file fh (pc);
return fh.facl (cmd, nentries, aclbufp); return fh.facl (cmd, nentries, aclbufp);
@ -691,7 +691,7 @@ fhandler_socket_local::facl (int cmd, int nentries, aclent_t *aclbufp)
int int
fhandler_socket_local::link (const char *newpath) fhandler_socket_local::link (const char *newpath)
{ {
if (!get_sun_path () || get_sun_path ()[0] == '\0') if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::link (newpath); return fhandler_socket_wsock::link (newpath);
fhandler_disk_file fh (pc); fhandler_disk_file fh (pc);
return fh.link (newpath); return fh.link (newpath);