Skip to content

Commit

Permalink
fix platform error code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Nov 8, 2024
1 parent e84a1a6 commit d79b5b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/aws/io/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum aws_socket_type {
* iOS | AWS_SIT_APPLE_NETWORK_FRAMEWORK
*/
enum aws_socket_impl_type {
AWS_SIT_PLATFORM_DEFAULT,
AWS_SIT_PLATFORM_DEFAULT = 0,
AWS_SIT_POSIX,
AWS_SIT_WINSOCK,
AWS_SIT_APPLE_NETWORK_FRAMEWORK,
Expand Down
12 changes: 6 additions & 6 deletions source/event_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct aws_event_loop *aws_event_loop_new_with_options(
break;
default:
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Invalid event loop type on the platform.");
aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
break;
}

Expand Down Expand Up @@ -588,30 +588,30 @@ static int aws_event_loop_type_validate_platform(enum aws_event_loop_type type)
case AWS_ELT_EPOLL:
#ifndef AWS_ENABLE_EPOLL
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Event loop type EPOLL is not supported on the platform.");
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
#endif // AWS_ENABLE_EPOLL
break;
case AWS_ELT_IOCP:
#ifndef AWS_ENABLE_IO_COMPLETION_PORTS
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Event loop type IOCP is not supported on the platform.");
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
#endif // AWS_ENABLE_IO_COMPLETION_PORTS
break;
case AWS_ELT_KQUEUE:
#ifndef AWS_ENABLE_KQUEUE
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Event loop type KQUEUE is not supported on the platform.");
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
#endif // AWS_ENABLE_KQUEUE
break;
case AWS_ELT_DISPATCH_QUEUE:
#ifndef AWS_ENABLE_DISPATCH_QUEUE
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Event loop type Dispatch Queue is not supported on the platform.");
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
#endif // AWS_ENABLE_DISPATCH_QUEUE
break;
default:
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Invalid event loop type.");
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
break;
}
return AWS_OP_SUCCESS;
Expand Down

0 comments on commit d79b5b7

Please sign in to comment.