mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
src: conditionalize use of S_ISSOCK macro
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>
This commit is contained in:
parent
cf308f13db
commit
3ec271bada
@ -10584,12 +10584,14 @@ virDomainOpenGraphics(virDomainPtr dom,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
if (!S_ISSOCK(sb.st_mode)) {
|
if (!S_ISSOCK(sb.st_mode)) {
|
||||||
virReportInvalidArg(fd,
|
virReportInvalidArg(fd,
|
||||||
_("fd %d must be a socket"),
|
_("fd %d must be a socket"),
|
||||||
fd);
|
fd);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
virCheckReadOnlyGoto(dom->conn->flags, error);
|
virCheckReadOnlyGoto(dom->conn->flags, error);
|
||||||
|
|
||||||
|
@ -1340,11 +1340,13 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((fd = open(p, O_RDWR)) < 0) {
|
if ((fd = open(p, O_RDWR)) < 0) {
|
||||||
|
#ifndef WIN32
|
||||||
if (S_ISSOCK(sb.st_mode)) {
|
if (S_ISSOCK(sb.st_mode)) {
|
||||||
/* Sockets can be opened only if there exists the
|
/* Sockets can be opened only if there exists the
|
||||||
* other side that listens. */
|
* other side that listens. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("unable to open %s"),
|
_("unable to open %s"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user