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
abcfcba6
Kaydet (Commit)
abcfcba6
authored
Ock 02, 2011
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
issue10802: fallback to pipe+fcntl when the pipe2 syscall fails with errno ENOSYS.
üst
e2dc0822
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
_posixsubprocess.c
Modules/_posixsubprocess.c
+29
-17
No files found.
Modules/_posixsubprocess.c
Dosyayı görüntüle @
abcfcba6
...
@@ -415,27 +415,39 @@ subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
...
@@ -415,27 +415,39 @@ subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
res
=
pipe2
(
fds
,
O_CLOEXEC
);
res
=
pipe2
(
fds
,
O_CLOEXEC
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
#else
if
(
res
!=
0
&&
errno
==
ENOSYS
)
/* We hold the GIL which offers some protection from other code calling
{
* fork() before the CLOEXEC flags have been set but we can't guarantee
if
(
PyErr_WarnEx
(
* anything without pipe2(). */
PyExc_RuntimeWarning
,
long
oldflags
;
"pipe2 set errno ENOSYS; falling "
"back to non-atomic pipe+fcntl."
,
1
)
!=
0
)
{
return
NULL
;
}
{
#endif
/* We hold the GIL which offers some protection from other code calling
* fork() before the CLOEXEC flags have been set but we can't guarantee
* anything without pipe2(). */
long
oldflags
;
res
=
pipe
(
fds
);
res
=
pipe
(
fds
);
if
(
res
==
0
)
{
if
(
res
==
0
)
{
oldflags
=
fcntl
(
fds
[
0
],
F_GETFD
,
0
);
oldflags
=
fcntl
(
fds
[
0
],
F_GETFD
,
0
);
if
(
oldflags
<
0
)
res
=
oldflags
;
if
(
oldflags
<
0
)
res
=
oldflags
;
}
}
if
(
res
==
0
)
if
(
res
==
0
)
res
=
fcntl
(
fds
[
0
],
F_SETFD
,
oldflags
|
FD_CLOEXEC
);
res
=
fcntl
(
fds
[
0
],
F_SETFD
,
oldflags
|
FD_CLOEXEC
);
if
(
res
==
0
)
{
if
(
res
==
0
)
{
oldflags
=
fcntl
(
fds
[
1
],
F_GETFD
,
0
);
oldflags
=
fcntl
(
fds
[
1
],
F_GETFD
,
0
);
if
(
oldflags
<
0
)
res
=
oldflags
;
if
(
oldflags
<
0
)
res
=
oldflags
;
}
if
(
res
==
0
)
res
=
fcntl
(
fds
[
1
],
F_SETFD
,
oldflags
|
FD_CLOEXEC
);
#ifdef HAVE_PIPE2
}
}
}
if
(
res
==
0
)
res
=
fcntl
(
fds
[
1
],
F_SETFD
,
oldflags
|
FD_CLOEXEC
);
#endif
#endif
if
(
res
!=
0
)
if
(
res
!=
0
)
return
PyErr_SetFromErrno
(
PyExc_OSError
);
return
PyErr_SetFromErrno
(
PyExc_OSError
);
...
...
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