Skip to content

Conversation

@devnexen
Copy link
Member

proposing a standard way to detect bitwise values through a new Zend entry.

static inline bool php_is_valid_flock_flag(zend_long s) {
const zend_long sb = s & ~PHP_LOCK_NB;
return (sb == PHP_LOCK_UN || sb == PHP_LOCK_SH ||
sb == PHP_LOCK_EX || s == -1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is -1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be an accepted value (a test uses it) even tough it does nothing. I may discard it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding -1 flag implies all flags set, thus more than 1 exclusive flag set, thus it should not be allowed and hence this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants