Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
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
geany
Commits
c1db044b
Kaydet (Commit)
c1db044b
authored
Nis 19, 2015
tarafından
Dimitar Zhekov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Separate spawn_read_cb() condition into input_cond and failure_cond
üst
d8ad369f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
spawn.c
src/spawn.c
+17
-17
No files found.
src/spawn.c
Dosyayı görüntüle @
c1db044b
...
...
@@ -654,7 +654,8 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
SpawnChannelData
*
sc
=
(
SpawnChannelData
*
)
data
;
GString
*
line_buffer
=
sc
->
line_buffer
;
GString
*
buffer
=
sc
->
buffer
?
sc
->
buffer
:
g_string_sized_new
(
sc
->
max_length
);
GIOCondition
failure
=
condition
&
G_IO_FAILURE
;
GIOCondition
input_cond
=
condition
&
(
G_IO_IN
|
G_IO_PRI
);
GIOCondition
failure_cond
=
condition
&
G_IO_FAILURE
;
/*
* - Normally, read only once. With IO watches, our data processing must be immediate,
* which may give the child time to emit more data, and a read loop may combine it into
...
...
@@ -662,7 +663,7 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
* - On failure, read in a loop. It won't block now, there will be no more data, and the
* IO watch is not guaranteed to be called again (under Windows this is the last call).
*/
if
(
condition
&
(
G_IO_IN
|
G_IO_PRI
)
)
if
(
input_cond
)
{
gsize
chars_read
;
GIOStatus
status
;
...
...
@@ -693,15 +694,14 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
{
g_string_append_len
(
buffer
,
line_buffer
->
str
,
line_len
);
g_string_erase
(
line_buffer
,
0
,
line_len
);
/* data only, failures are reported separately below */
sc
->
cb
.
read
(
buffer
,
condition
&
(
G_IO_IN
|
G_IO_PRI
),
sc
->
cb_data
);
/* input only, failures are reported separately below */
sc
->
cb
.
read
(
buffer
,
input_cond
,
sc
->
cb_data
);
g_string_truncate
(
buffer
,
0
);
n
=
0
;
}
}
if
(
!
failure
)
if
(
!
failure
_cond
)
break
;
}
}
...
...
@@ -711,10 +711,10 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
&
chars_read
,
NULL
))
==
G_IO_STATUS_NORMAL
)
{
g_string_set_size
(
buffer
,
chars_read
);
/*
data
only, failures are reported separately below */
sc
->
cb
.
read
(
buffer
,
condition
&
(
G_IO_IN
|
G_IO_PRI
)
,
sc
->
cb_data
);
/*
input
only, failures are reported separately below */
sc
->
cb
.
read
(
buffer
,
input_cond
,
sc
->
cb_data
);
if
(
!
failure
)
if
(
!
failure
_cond
)
break
;
}
}
...
...
@@ -723,33 +723,33 @@ static gboolean spawn_read_cb(GIOChannel *channel, GIOCondition condition, gpoin
of error conditions, so we convert the termination statuses into conditions.
Should not hurt the other OS. */
if
(
status
==
G_IO_STATUS_ERROR
)
failure
|=
G_IO_ERR
;
failure
_cond
|=
G_IO_ERR
;
else
if
(
status
==
G_IO_STATUS_EOF
)
failure
|=
G_IO_HUP
;
failure
_cond
|=
G_IO_HUP
;
}
if
(
failure
)
/* we must signal the callback */
if
(
failure
_cond
)
/* we must signal the callback */
{
if
(
line_buffer
&&
line_buffer
->
len
)
/* flush the line buffer */
{
g_string_append_len
(
buffer
,
line_buffer
->
str
,
line_buffer
->
len
);
/* all data may be from a previous call */
if
(
!
(
condition
&
(
G_IO_IN
|
G_IO_PRI
))
)
condition
|
=
G_IO_IN
;
if
(
!
input_cond
)
input_cond
=
G_IO_IN
;
}
else
{
condition
&=
~
(
G_IO_IN
|
G_IO_PRI
)
;
input_cond
=
0
;
g_string_truncate
(
buffer
,
0
);
}
sc
->
cb
.
read
(
buffer
,
condition
|
failure
,
sc
->
cb_data
);
sc
->
cb
.
read
(
buffer
,
input_cond
|
failure_cond
,
sc
->
cb_data
);
}
if
(
buffer
!=
sc
->
buffer
)
g_string_free
(
buffer
,
TRUE
);
return
!
failure
;
return
!
failure
_cond
;
}
...
...
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