summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-finder-avahi.c
diff options
context:
space:
mode:
authorSam Spilsbury <sam@endlessm.com>2018-01-16 09:23:11 +0800
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-18 19:39:33 +0000
commit002e5eeac605093e1f3935f10f8ae30fd4a2e659 (patch)
treed417caf7e31225c4d4e0cf8747a38b510b1c024a /src/libostree/ostree-repo-finder-avahi.c
parent16d3359bf8827f6a6d70aa313c6e7f16a4f2e277 (diff)
downloadostree-002e5eeac605093e1f3935f10f8ae30fd4a2e659.tar.gz
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
Diffstat (limited to 'src/libostree/ostree-repo-finder-avahi.c')
-rw-r--r--src/libostree/ostree-repo-finder-avahi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libostree/ostree-repo-finder-avahi.c b/src/libostree/ostree-repo-finder-avahi.c
index 514351fc..1e77a6e0 100644
--- a/src/libostree/ostree-repo-finder-avahi.c
+++ b/src/libostree/ostree-repo-finder-avahi.c
@@ -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;
}