@@ -724,11 +724,20 @@ def check_stat(uid, gid):
724724 chown_func (first_param , uid , - 1 )
725725 check_stat (uid , gid )
726726
727- if uid == 0 :
727+ if sys .platform == "vxworks" :
728+ # On VxWorks, root user id is 1 and 0 means no login user:
729+ # both are super users.
730+ is_root = (uid in (0 , 1 ))
731+ else :
732+ is_root = (uid == 0 )
733+ if is_root :
728734 # Try an amusingly large uid/gid to make sure we handle
729735 # large unsigned values. (chown lets you use any
730736 # uid/gid you like, even if they aren't defined.)
731737 #
738+ # On VxWorks uid_t is defined as unsigned short. A big
739+ # value greater than 65535 will result in underflow error.
740+ #
732741 # This problem keeps coming up:
733742 # http://bugs.python.org/issue1747858
734743 # http://bugs.python.org/issue4591
@@ -738,7 +747,7 @@ def check_stat(uid, gid):
738747 # This part of the test only runs when run as root.
739748 # Only scary people run their tests as root.
740749
741- big_value = 2 ** 31
750+ big_value = ( 2 ** 31 if sys . platform != "vxworks" else 2 ** 15 )
742751 chown_func (first_param , big_value , big_value )
743752 check_stat (big_value , big_value )
744753 chown_func (first_param , - 1 , - 1 )
0 commit comments