]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Silence warning on arithmetic operation on socket flags
authorMichalis Pappas <michalis@unikraft.io>
Sat, 30 Dec 2023 10:43:34 +0000 (11:43 +0100)
committerRazvan Deaconescu <razvan.deaconescu@upb.ro>
Sun, 31 Dec 2023 17:04:16 +0000 (19:04 +0200)
Wrap bitwise OR of socket flags around parenthesis to
silcence compiler warning.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #43

sockets.c

index a0bb7151c7275feeddaf80e2714fcb2223a1c9e7..0dbf5a8523d3306babf8c4b0e3d2afc8d309bd8b 100644 (file)
--- a/sockets.c
+++ b/sockets.c
@@ -80,7 +80,7 @@ lwip_posix_socket_create(struct posix_socket_driver *d, int family, int type,
        int flags, rc;
 
        /* Blocking is handled by posix-socket */
-       flags = type & SOCK_FLAGS | SOCK_NONBLOCK;
+       flags = type & (SOCK_FLAGS | SOCK_NONBLOCK);
        type = type & ~SOCK_FLAGS;
 
        lwip_fd = lwip_socket(family, type, protocol);