diff --git a/common/utils/windows-compat.h b/common/utils/windows-compat.h index 658c1d8bc..6d84a39a3 100644 --- a/common/utils/windows-compat.h +++ b/common/utils/windows-compat.h @@ -1,5 +1,5 @@ /* nbdkit - * Copyright (C) 2020 Red Hat Inc. + * Copyright (C) 2020-2022 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -85,6 +85,12 @@ struct sockaddr_un #define ESHUTDOWN ECONNABORTED #endif +/* Windows uses non-standard names for shutdown(how). */ +#ifndef SHUT_WR +#define SHUT_WR SD_SEND +#define SHUT_RDWR SD_BOTH +#endif + /* This generated function translates Winsock errors into errno codes. */ extern int translate_winsock_error (const char *fn, int err); diff --git a/filters/blocksize-policy/policy.c b/filters/blocksize-policy/policy.c index f7cff2f11..7e6f2a968 100644 --- a/filters/blocksize-policy/policy.c +++ b/filters/blocksize-policy/policy.c @@ -43,6 +43,7 @@ #include "ispowerof2.h" #include "rounding.h" +#include "windows-compat.h" /* Block size constraints configured on the command line (0 = unset). */ static uint32_t config_minimum;