#ifdef ENABLE_KDBUS
asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, (unsigned long) getuid(), ee);
#else
- asprintf(&b->address, UNIX_USER_BUS_FMT, (unsigned long) getuid());
+ asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
#endif
} else {
#ifdef ENABLE_KDBUS
/* We'll leave the fd open in case this is a kernel bus, since
* there might still be memblocks around that reference this
- * bus, and they might need to invoke the * KDBUS_CMD_FREE
+ * bus, and they might need to invoke the KDBUS_CMD_FREE
* ioctl on the fd when they are freed. */
}
if (r < 0)
return r;
- /* Remarshall if we have to. This will possible unref the
+ /* Remarshall if we have to. This will possibly unref the
* message and place a replacement in m */
r = bus_remarshal_message(bus, &m);
if (r < 0)
r = bus_write_message(bus, m, &idx);
if (r < 0) {
- if (r == -EPIPE || r == -ENOTCONN || r == -ESHUTDOWN)
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
+ return -ECONNRESET;
+ }
return r;
} else if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) {
r = bus_read_message(bus);
if (r < 0) {
- if (r == -EPIPE || r == -ENOTCONN || r == -ESHUTDOWN)
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
+ return -ECONNRESET;
+ }
return r;
}
r = dispatch_wqueue(bus);
if (r < 0) {
- if (r == -EPIPE || r == -ENOTCONN || r == -ESHUTDOWN)
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
+ return -ECONNRESET;
+ }
return r;
}
case BUS_OPENING:
r = bus_socket_process_opening(bus);
- if (r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
r = 1;
} else if (r < 0)
case BUS_AUTHENTICATING:
r = bus_socket_process_authenticating(bus);
- if (r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
r = 1;
} else if (r < 0)
case BUS_RUNNING:
case BUS_HELLO:
r = process_running(bus, ret);
- if (r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
r = 1;
for (;;) {
r = dispatch_wqueue(bus);
if (r < 0) {
- if (r == -EPIPE || r == -ENOTCONN || r == -ESHUTDOWN)
+ if (r == -ENOTCONN || r == -ECONNRESET || r == -EPIPE || r == -ESHUTDOWN) {
bus_enter_closing(bus);
+ return -ECONNRESET;
+ }
return r;
}