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
02d74f68
Kaydet (Commit)
02d74f68
authored
Kas 30, 2004
tarafından
Michael W. Hudson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Hear the #error: change the default value of the mutable_arg argument
to ioctl() and remove the warning when it is not supplied.
üst
a3bc546d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
libfcntl.tex
Doc/lib/libfcntl.tex
+3
-5
fcntlmodule.c
Modules/fcntlmodule.c
+1
-11
No files found.
Doc/lib/libfcntl.tex
Dosyayı görüntüle @
02d74f68
...
...
@@ -78,11 +78,9 @@ The module defines the following functions:
long which is then passed to
\function
{
ioctl()
}
and copied back into
the supplied buffer.
If
\var
{
mutate
_
flag
}
is not supplied, then in 2.3 it defaults to
false. This is planned to change over the next few Python versions:
in 2.4 failing to supply
\var
{
mutate
_
flag
}
will get a warning but
the same behavior and in versions later than 2.5 it will default to
true.
If
\var
{
mutate
_
flag
}
is not supplied, then from Python 2.5 it
defaults to true, which is a change from versions 2.3 and 2.4.
Supply the argument explicitly if version portability is a priority.
An example:
...
...
Modules/fcntlmodule.c
Dosyayı görüntüle @
02d74f68
...
...
@@ -99,7 +99,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
int
ret
;
char
*
str
;
int
len
;
int
mutate_arg
=
0
;
int
mutate_arg
=
1
;
char
buf
[
1024
];
if
(
PyArg_ParseTuple
(
args
,
"O&iw#|i:ioctl"
,
...
...
@@ -107,16 +107,6 @@ fcntl_ioctl(PyObject *self, PyObject *args)
&
str
,
&
len
,
&
mutate_arg
))
{
char
*
arg
;
if
(
PyTuple_Size
(
args
)
==
3
)
{
#if (PY_MAJOR_VERSION>2) || (PY_MINOR_VERSION>=5)
#error Remove the warning, change mutate_arg to 1
#endif
if
(
PyErr_Warn
(
PyExc_FutureWarning
,
"ioctl with mutable buffer will mutate the buffer by default in 2.5"
)
<
0
)
return
NULL
;
mutate_arg
=
0
;
}
if
(
mutate_arg
)
{
if
(
len
<=
sizeof
buf
)
{
memcpy
(
buf
,
str
,
len
);
...
...
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