]> xenbits.xensource.com Git - libvirt.git/commitdiff
src: conditionalize use of S_ISSOCK macro
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Jan 2020 11:17:49 +0000 (11:17 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 29 Jan 2020 14:51:40 +0000 (14:51 +0000)
The S_ISSOCK macro is not available on Windows platforms.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt-domain.c
src/security/security_manager.c

index 4074397b30c3bba8b57d2058b3608234dd7a20ec..ceda85c2432215dbe3f555a9ad856d31eb9e613d 100644 (file)
@@ -10584,12 +10584,14 @@ virDomainOpenGraphics(virDomainPtr dom,
         goto error;
     }
 
+#ifndef WIN32
     if (!S_ISSOCK(sb.st_mode)) {
         virReportInvalidArg(fd,
                             _("fd %d must be a socket"),
                             fd);
         goto error;
     }
+#endif /* !WIN32 */
 
     virCheckReadOnlyGoto(dom->conn->flags, error);
 
index f229d945704b6fe3626983dc3a622a363f942696..fe9def7fb9dde4e654adc1f19b2ec8c9e2f3e0ad 100644 (file)
@@ -1340,11 +1340,13 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED,
         }
 
         if ((fd = open(p, O_RDWR)) < 0) {
+#ifndef WIN32
             if (S_ISSOCK(sb.st_mode)) {
                 /* Sockets can be opened only if there exists the
                  * other side that listens. */
                 continue;
             }
+#endif /* !WIN32 */
 
             virReportSystemError(errno,
                                  _("unable to open %s"),