Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
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ç
LibreOffice
core
Commits
465f876f
Kaydet (Commit)
465f876f
authored
Kas 03, 2013
tarafından
Julien Nabet
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cppcheck: reduce scope in AvahiNetworkService
Change-Id: Ida14cc278187fdc7519137829a920273ed4910b3
üst
8378d3a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
AvahiNetworkService.cxx
sd/source/ui/remotecontrol/AvahiNetworkService.cxx
+7
-4
No files found.
sd/source/ui/remotecontrol/AvahiNetworkService.cxx
Dosyayı görüntüle @
465f876f
...
@@ -79,8 +79,6 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
...
@@ -79,8 +79,6 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
}
}
static
void
create_services
(
AvahiClient
*
c
)
{
static
void
create_services
(
AvahiClient
*
c
)
{
char
*
n
,
r
[
128
];
int
ret
;
assert
(
c
);
assert
(
c
);
/* If this is the first time we're called, let's create a new
/* If this is the first time we're called, let's create a new
...
@@ -97,13 +95,18 @@ static void create_services(AvahiClient *c) {
...
@@ -97,13 +95,18 @@ static void create_services(AvahiClient *c) {
if
(
avahi_entry_group_is_empty
(
group
))
{
if
(
avahi_entry_group_is_empty
(
group
))
{
fprintf
(
stderr
,
"Adding service '%s'
\n
"
,
avahiService
->
getName
().
c_str
());
fprintf
(
stderr
,
"Adding service '%s'
\n
"
,
avahiService
->
getName
().
c_str
());
char
r
[
128
];
snprintf
(
r
,
sizeof
(
r
),
"random=%i"
,
rand
());
snprintf
(
r
,
sizeof
(
r
),
"random=%i"
,
rand
());
if
((
ret
=
avahi_entry_group_add_service
(
group
,
AVAHI_IF_UNSPEC
,
AVAHI_PROTO_UNSPEC
,
static_cast
<
AvahiPublishFlags
>
(
0
),
avahiService
->
getName
().
c_str
(),
kREG_TYPE
,
NULL
,
NULL
,
1599
,
"local"
,
r
,
NULL
))
<
0
)
{
int
ret
=
avahi_entry_group_add_service
(
group
,
AVAHI_IF_UNSPEC
,
AVAHI_PROTO_UNSPEC
,
static_cast
<
AvahiPublishFlags
>
(
0
),
avahiService
->
getName
().
c_str
(),
kREG_TYPE
,
NULL
,
NULL
,
1599
,
"local"
,
r
,
NULL
);
if
(
ret
<
0
)
{
if
(
ret
==
AVAHI_ERR_COLLISION
){
if
(
ret
==
AVAHI_ERR_COLLISION
){
/* A service name collision with a local service happened. Let's
/* A service name collision with a local service happened. Let's
* pick a new name */
* pick a new name */
n
=
avahi_alternative_service_name
(
avahiService
->
getName
().
c_str
());
char
*
n
=
avahi_alternative_service_name
(
avahiService
->
getName
().
c_str
());
avahiService
->
setName
(
n
);
avahiService
->
setName
(
n
);
fprintf
(
stderr
,
"Service name collision, renaming service to '%s'
\n
"
,
avahiService
->
getName
().
c_str
());
fprintf
(
stderr
,
"Service name collision, renaming service to '%s'
\n
"
,
avahiService
->
getName
().
c_str
());
...
...
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