r43510 - python/trunk/Modules/posixmodule.c

March 31, 2006
4:38 p.m.
Author: thomas.wouters Date: Sat Apr 1 00:38:19 2006 New Revision: 43510 Modified: python/trunk/Modules/posixmodule.c Log: In the fdopen(fd, 'a') case on UNIX, don't try to set fd's flags to -1 if fcntl() and fdopen() both fail. Will backport. Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sat Apr 1 00:38:19 2006 @@ -5777,7 +5777,7 @@ if (flags != -1) fcntl(fd, F_SETFL, flags | O_APPEND); fp = fdopen(fd, mode); - if (fp == NULL) + if (fp == NULL && flags != -1) /* restore old mode if fdopen failed */ fcntl(fd, F_SETFL, flags); } else {
6922
Age (days ago)
6922
Last active (days ago)
0 comments
1 participants
participants (1)
-
thomas.wouters