]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Silence warning on arithmetic operation on socket flags RELEASE-0.16.0
authorMichalis Pappas <michalis@unikraft.io>
Mon, 1 Jan 2024 14:41:40 +0000 (15:41 +0100)
committerRazvan Deaconescu <razvan.deaconescu@upb.ro>
Tue, 2 Jan 2024 19:11:17 +0000 (21:11 +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>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #44

sockets.c

index a0bb7151c7275feeddaf80e2714fcb2223a1c9e7..1af7a94fad1f83b9490624bb3322a2aa1309483c 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);