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
07b14dd8
Kaydet (Commit)
07b14dd8
authored
Tem 26, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add locking where it exists
üst
ef38b78f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
dbhashmodule.c
Modules/dbhashmodule.c
+16
-5
No files found.
Modules/dbhashmodule.c
Dosyayı görüntüle @
07b14dd8
...
@@ -334,19 +334,30 @@ dbhashopen(self, args)
...
@@ -334,19 +334,30 @@ dbhashopen(self, args)
return
NULL
;
return
NULL
;
if
(
flag
!=
NULL
)
{
if
(
flag
!=
NULL
)
{
/* XXX need a way to pass O_EXCL, O_EXLOCK, O_NONBLOCK, O_SHLOCK */
/* XXX need a way to pass O_EXCL, O_EXLOCK, O_NONBLOCK, O_SHLOCK */
if
(
strcmp
(
flag
,
"r"
)
==
0
)
if
(
flag
[
0
]
==
'r'
)
flags
=
O_RDONLY
;
flags
=
O_RDONLY
;
else
if
(
strcmp
(
flag
,
"w"
)
==
0
)
else
if
(
flag
[
0
]
==
'w'
)
flags
=
O_RDWR
;
flags
=
O_RDWR
;
else
if
(
strcmp
(
flag
,
"c"
)
==
0
)
else
if
(
flag
[
0
]
==
'c'
)
flags
=
O_RDWR
|
O_CREAT
;
flags
=
O_RDWR
|
O_CREAT
;
else
if
(
strcmp
(
flag
,
"n"
)
==
0
)
else
if
(
flag
[
0
]
==
'n'
)
flags
=
O_RDWR
|
O_CREAT
|
O_TRUNC
;
flags
=
O_RDWR
|
O_CREAT
|
O_TRUNC
;
else
{
else
{
err_setstr
(
DbhashError
,
err_setstr
(
DbhashError
,
"Flag should be
one of
'r', 'w', 'c' or 'n'"
);
"Flag should be
gin with
'r', 'w', 'c' or 'n'"
);
return
NULL
;
return
NULL
;
}
}
if
(
flag
[
1
]
==
'l'
)
{
#if defined(O_EXLOCK) && defined(O_SHLOCK)
if
(
flag
[
0
]
==
'r'
)
flags
|=
O_SHLOCK
;
else
flags
|=
O_EXLOCK
;
#else
err_setstr
(
DbhashError
,
"locking not supported on this platform"
);
return
NULL
;
#endif
}
}
}
return
newdbhashobject
(
file
,
flags
,
mode
,
return
newdbhashobject
(
file
,
flags
,
mode
,
bsize
,
ffactor
,
nelem
,
cachesize
,
hash
,
lorder
);
bsize
,
ffactor
,
nelem
,
cachesize
,
hash
,
lorder
);
...
...
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