diff options
Diffstat (limited to 'src/faudit/dbus.c')
-rw-r--r-- | src/faudit/dbus.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/faudit/dbus.c b/src/faudit/dbus.c index 1b1fbb817..54300c9b8 100644 --- a/src/faudit/dbus.c +++ b/src/faudit/dbus.c | |||
@@ -28,7 +28,7 @@ int check_unix(const char *sockfile) { | |||
28 | 28 | ||
29 | // open socket | 29 | // open socket |
30 | int sock = socket(AF_UNIX, SOCK_STREAM, 0); | 30 | int sock = socket(AF_UNIX, SOCK_STREAM, 0); |
31 | if (sock == -1) | 31 | if (sock == -1) |
32 | return rv; | 32 | return rv; |
33 | 33 | ||
34 | // connect | 34 | // connect |
@@ -41,7 +41,7 @@ int check_unix(const char *sockfile) { | |||
41 | remote.sun_path[0] = '\0'; | 41 | remote.sun_path[0] = '\0'; |
42 | if (connect(sock, (struct sockaddr *)&remote, len) == 0) | 42 | if (connect(sock, (struct sockaddr *)&remote, len) == 0) |
43 | rv = 0; | 43 | rv = 0; |
44 | 44 | ||
45 | close(sock); | 45 | close(sock); |
46 | return rv; | 46 | return rv; |
47 | } | 47 | } |
@@ -60,7 +60,7 @@ void dbus_test(void) { | |||
60 | *sockfile = '@'; | 60 | *sockfile = '@'; |
61 | char *ptr = strchr(sockfile, ','); | 61 | char *ptr = strchr(sockfile, ','); |
62 | if (ptr) | 62 | if (ptr) |
63 | *ptr = '\0'; | 63 | *ptr = '\0'; |
64 | rv = check_unix(sockfile); | 64 | rv = check_unix(sockfile); |
65 | *sockfile = '@'; | 65 | *sockfile = '@'; |
66 | if (rv == 0) | 66 | if (rv == 0) |
@@ -83,13 +83,10 @@ void dbus_test(void) { | |||
83 | printf("UGLY: session bus configured for TCP communication.\n"); | 83 | printf("UGLY: session bus configured for TCP communication.\n"); |
84 | else | 84 | else |
85 | printf("GOOD: cannot find a D-Bus socket\n"); | 85 | printf("GOOD: cannot find a D-Bus socket\n"); |
86 | 86 | ||
87 | 87 | ||
88 | free(bus); | 88 | free(bus); |
89 | } | 89 | } |
90 | else | 90 | else |
91 | printf("GOOD: DBUS_SESSION_BUS_ADDRESS environment variable not configured."); | 91 | printf("GOOD: DBUS_SESSION_BUS_ADDRESS environment variable not configured."); |
92 | } | 92 | } |
93 | |||
94 | |||
95 | |||