In Modules/fcntlmodule.c, there is a code to insert symbolic constants to the module. all_ins(m); But we don't check the return code of the function whether it is successful or not, unlike in posix module in which we check it. if (all_ins(m)) return NULL; Attached the patch to add checking of the return code of all_ins function in fcntl module file.
Charles-François Natali, sorry I just noticed Ezio's comment. The all_ins function return -1 on failure and 0 on success. I use this form: if (all_ins(m)) return NULL; because I follow the example in Modules/posixmodule.c. If this form: if (all_ins(m) < 0) return NULL; is better, then so be it, here is the patch to accommodate Ezio's suggestion.