Skip to content

Commit

Permalink
Build failed due to -Werror option (dotnet#32040)
Browse files Browse the repository at this point in the history
* fixed error processing for pipe2 call in Unix/../pal_process.c

Due to -Werror warning (function result not checked) is converted to an
error.

Fix dotnet#32038

* fixed warnings in Unix/../pal_networking.c

Due to -Werror all warnings (wrong signess, wrong types) converted to
errors, so why this changes needed.

Fix dotnet#32038
  • Loading branch information
0xfk0 authored Feb 11, 2020
1 parent fe48390 commit 7fa8ea8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/libraries/Native/Unix/System.Native/pal_networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ int32_t SystemNative_GetNameInfo(const uint8_t* address,
(uint32_t)hostLength,
(char*)service,
(uint32_t)serviceLength,
nativeFlags);
(int)nativeFlags);
}
else
{
Expand All @@ -508,7 +508,7 @@ int32_t SystemNative_GetNameInfo(const uint8_t* address,
(uint32_t)hostLength,
(char*)service,
(uint32_t)serviceLength,
nativeFlags);
(int)nativeFlags);
}

return ConvertGetAddrInfoAndGetNameInfoErrorsToPal(result);
Expand Down Expand Up @@ -1489,11 +1489,7 @@ int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socket
int err = bind(
fd,
(struct sockaddr*)socketAddress,
#if BIND_ADDRLEN_UNSIGNED
(socklen_t)socketAddressLen);
#else
socketAddressLen);
#endif

return err == 0 ? Error_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
}
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/Native/Unix/System.Native/pal_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ int32_t SystemNative_ForkAndExecProcess(const char* filename,
// Process is still the clone of this one. This is a best-effort attempt, so ignore any errors.
// If the child fails to exec we use the pipe to pass the errno to the parent process.
#if HAVE_PIPE2
pipe2(waitForChildToExecPipe, O_CLOEXEC);
(void)! pipe2(waitForChildToExecPipe, O_CLOEXEC);
#else
SystemNative_Pipe(waitForChildToExecPipe, PAL_O_CLOEXEC);
(void)! SystemNative_Pipe(waitForChildToExecPipe, PAL_O_CLOEXEC);
#endif

// The fork child must not be signalled until it calls exec(): our signal handlers do not
Expand Down

0 comments on commit 7fa8ea8

Please sign in to comment.