Commit f415a693 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

unix: report errors from unlinking stale sockets

Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4c1ffde8
...@@ -1238,6 +1238,12 @@ static int unlink_stale(struct unix_sk_info *ui) ...@@ -1238,6 +1238,12 @@ static int unlink_stale(struct unix_sk_info *ui)
return -1; return -1;
ret = unlinkat(AT_FDCWD, ui->name, 0) ? -1 : 0; ret = unlinkat(AT_FDCWD, ui->name, 0) ? -1 : 0;
if (ret < 0) {
pr_perror("Can't unlink stale socket %#x peer %#x (name %s dir %s)\n",
ui->ue->ino, ui->ue->peer,
ui->name ? (ui->name[0] ? ui->name : &ui->name[1]) : "-",
ui->name_dir ? ui->name_dir : "-");
}
revert_unix_sk_cwd(&cwd_fd); revert_unix_sk_cwd(&cwd_fd);
return ret; return ret;
...@@ -1258,12 +1264,7 @@ static int collect_one_unixsk(void *o, ProtobufCMessage *base) ...@@ -1258,12 +1264,7 @@ static int collect_one_unixsk(void *o, ProtobufCMessage *base)
ui->name = (void *)ui->ue->name.data; ui->name = (void *)ui->ue->name.data;
if (unlink_stale(ui)) { unlink_stale(ui);
pr_warn("Can't unlink stale socket %#x peer %#x (name %s dir %s)\n",
ui->ue->ino, ui->ue->peer,
ui->name ? (ui->name[0] ? ui->name : &ui->name[1]) : "-",
ui->name_dir ? ui->name_dir : "-");
}
} else } else
ui->name = NULL; ui->name = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment