Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
61f0da8c
Kaydet (Commit)
61f0da8c
authored
Ock 21, 2012
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
bugfix for issue 8052 fixes on *BSD platforms.
üst
33b24f7e
e3f7848b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
_posixsubprocess.c
Modules/_posixsubprocess.c
+13
-9
No files found.
Modules/_posixsubprocess.c
Dosyayı görüntüle @
61f0da8c
...
@@ -15,12 +15,17 @@
...
@@ -15,12 +15,17 @@
#include <dirent.h>
#include <dirent.h>
#endif
#endif
#if defined(sun) && !defined(HAVE_DIRFD)
#if defined(sun)
/* readdir64 is used to work around Solaris 9 bug 6395699. */
# define readdir readdir64
# define dirent dirent64
# if !defined(HAVE_DIRFD)
/* Some versions of Solaris lack dirfd(). */
/* Some versions of Solaris lack dirfd(). */
# define DIRFD(dirp) ((dirp)->dd_fd)
# define DIRFD(dirp) ((dirp)->dd_fd)
# define HAVE_DIRFD
# define HAVE_DIRFD
#else
# else
# define DIRFD(dirp) (dirfd(dirp))
# define DIRFD(dirp) (dirfd(dirp))
# endif
#endif
#endif
#define LINUX_SOLARIS_FD_DIR "/proc/self/fd"
#define LINUX_SOLARIS_FD_DIR "/proc/self/fd"
...
@@ -206,7 +211,7 @@ static void _close_open_fd_range_safe(int start_fd, int end_fd,
...
@@ -206,7 +211,7 @@ static void _close_open_fd_range_safe(int start_fd, int end_fd,
* exclusive. Do not close any in the sorted py_fds_to_keep list.
* exclusive. Do not close any in the sorted py_fds_to_keep list.
*
*
* This function violates the strict use of async signal safe functions. :(
* This function violates the strict use of async signal safe functions. :(
* It calls opendir(), readdir
64
() and closedir(). Of these, the one most
* It calls opendir(), readdir() and closedir(). Of these, the one most
* likely to ever cause a problem is opendir() as it performs an internal
* likely to ever cause a problem is opendir() as it performs an internal
* malloc(). Practically this should not be a problem. The Java VM makes the
* malloc(). Practically this should not be a problem. The Java VM makes the
* same calls between fork and exec in its own UNIXProcess_md.c implementation.
* same calls between fork and exec in its own UNIXProcess_md.c implementation.
...
@@ -243,15 +248,14 @@ static void _close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
...
@@ -243,15 +248,14 @@ static void _close_open_fd_range_maybe_unsafe(int start_fd, int end_fd,
/* No way to get a list of open fds. */
/* No way to get a list of open fds. */
_close_fds_by_brute_force
(
start_fd
,
end_fd
,
py_fds_to_keep
);
_close_fds_by_brute_force
(
start_fd
,
end_fd
,
py_fds_to_keep
);
}
else
{
}
else
{
struct
dirent
64
*
dir_entry
;
struct
dirent
*
dir_entry
;
#ifdef HAVE_DIRFD
#ifdef HAVE_DIRFD
int
fd_used_by_opendir
=
DIRFD
(
proc_fd_dir
);
int
fd_used_by_opendir
=
DIRFD
(
proc_fd_dir
);
#else
#else
int
fd_used_by_opendir
=
start_fd
-
1
;
int
fd_used_by_opendir
=
start_fd
-
1
;
#endif
#endif
errno
=
0
;
errno
=
0
;
/* readdir64 is used to work around Solaris 9 bug 6395699. */
while
((
dir_entry
=
readdir
(
proc_fd_dir
)))
{
while
((
dir_entry
=
readdir64
(
proc_fd_dir
)))
{
int
fd
;
int
fd
;
if
((
fd
=
_pos_int_from_ascii
(
dir_entry
->
d_name
))
<
0
)
if
((
fd
=
_pos_int_from_ascii
(
dir_entry
->
d_name
))
<
0
)
continue
;
/* Not a number. */
continue
;
/* Not a number. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment