avahi: Don't complain with g_warning if the daemon wasn't running

This is a normal case when running unit tests in client code
on continuous integration infrastructure. When those tests are
running they will set G_DEBUG=fatal-warnings which will cause
the program to abort if a warning is emitted. Instead, emit
a debug message if the problem was that we couldn't connect to
the daemon.

Closes: #1542
Approved by: jlebon
This commit is contained in:
Sam Spilsbury authored and Atomic Bot committed 2018-04-18 19:39:33 +00:00
1 parent 16d3359bf8
commit 002e5eeac6
2 files changed
+23 -4

No files matched your search

+9 -3
View File
@@ -1437,9 +1437,15 @@ ostree_repo_finder_avahi_start (OstreeRepoFinderAvahi *self,
if (client == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to create finder client: %s",
avahi_strerror (failure));
if (failure == AVAHI_ERR_NO_DAEMON)
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"Avahi daemon is not running: %s",
avahi_strerror (failure));
else
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to create finder client: %s",
avahi_strerror (failure));
return;
}