Skip to content
Snippets Groups Projects
Commit bedf16b0 authored by Sean Bright's avatar Sean Bright
Browse files

utils: Don't set or clear flags that don't need setting or clearing

Change-Id: I0e7fb507ac09b15e45e1ff8501ecfca67afa5217
parent 82473227
No related branches found
No related tags found
No related merge requests found
......@@ -2730,9 +2730,17 @@ int __ast_fd_set_flags(int fd, int flags, enum ast_fd_flag_operation op,
switch (op) {
case AST_FD_FLAG_SET:
if ((f & flags) == flags) {
/* There is nothing to set */
return 0;
}
f |= flags;
break;
case AST_FD_FLAG_CLEAR:
if (!(f & flags)) {
/* There is nothing to clear */
return 0;
}
f &= ~flags;
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment