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
42185a2d
Kaydet (Commit)
42185a2d
authored
Ock 09, 1997
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Plugged a couple of potential return value problems, memory leaks, and
descriptor leaks.
üst
2dc8c2c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
sunaudiodev.c
Modules/sunaudiodev.c
+13
-8
No files found.
Modules/sunaudiodev.c
Dosyayı görüntüle @
42185a2d
...
@@ -118,8 +118,10 @@ newsadobject(arg)
...
@@ -118,8 +118,10 @@ newsadobject(arg)
/* Create and initialize the object */
/* Create and initialize the object */
xp
=
PyObject_NEW
(
sadobject
,
&
Sadtype
);
xp
=
PyObject_NEW
(
sadobject
,
&
Sadtype
);
if
(
xp
==
NULL
)
if
(
xp
==
NULL
)
{
close
(
fd
);
return
NULL
;
return
NULL
;
}
xp
->
x_fd
=
fd
;
xp
->
x_fd
=
fd
;
xp
->
x_icount
=
xp
->
x_ocount
=
0
;
xp
->
x_icount
=
xp
->
x_ocount
=
0
;
xp
->
x_isctl
=
(
imode
<
0
);
xp
->
x_isctl
=
(
imode
<
0
);
...
@@ -162,9 +164,9 @@ sad_read(self, args)
...
@@ -162,9 +164,9 @@ sad_read(self, args)
}
}
#if 0
#if 0
/* TBD: why print this message if you can handle the condition?
/* TBD: why print this message if you can handle the condition?
assume it's debugging info which we can just as well get rid
*
assume it's debugging info which we can just as well get rid
of. in any case this message should *not* be using printf!
*
of. in any case this message should *not* be using printf!
*/
*/
if (count != size)
if (count != size)
printf("sunaudio: funny read rv %d wtd %d\n", count, size);
printf("sunaudio: funny read rv %d wtd %d\n", count, size);
#endif
#endif
...
@@ -211,7 +213,9 @@ sad_getinfo(self, args)
...
@@ -211,7 +213,9 @@ sad_getinfo(self, args)
if
(
!
PyArg_Parse
(
args
,
""
))
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
NULL
;
rv
=
sads_alloc
();
if
(
!
(
rv
=
sads_alloc
()))
return
NULL
;
if
(
ioctl
(
self
->
x_fd
,
AUDIO_GETINFO
,
&
rv
->
ai
)
<
0
)
{
if
(
ioctl
(
self
->
x_fd
,
AUDIO_GETINFO
,
&
rv
->
ai
)
<
0
)
{
PyErr_SetFromErrno
(
SunAudioError
);
PyErr_SetFromErrno
(
SunAudioError
);
Py_DECREF
(
rv
);
Py_DECREF
(
rv
);
...
@@ -501,7 +505,8 @@ initsunaudiodev()
...
@@ -501,7 +505,8 @@ initsunaudiodev()
m
=
Py_InitModule
(
"sunaudiodev"
,
sunaudiodev_methods
);
m
=
Py_InitModule
(
"sunaudiodev"
,
sunaudiodev_methods
);
d
=
PyModule_GetDict
(
m
);
d
=
PyModule_GetDict
(
m
);
SunAudioError
=
PyString_FromString
(
"sunaudiodev.error"
);
SunAudioError
=
PyString_FromString
(
"sunaudiodev.error"
);
if
(
SunAudioError
==
NULL
||
if
(
SunAudioError
)
PyDict_SetItemString
(
d
,
"error"
,
SunAudioError
)
)
PyDict_SetItemString
(
d
,
"error"
,
SunAudioError
);
Py_FatalError
(
"can't define sunaudiodev.error"
);
if
(
PyErr_Occurred
())
Py_FatalError
(
"can't initialize sunaudiodev module"
);
}
}
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