From cd4a9c413a069c33b821620ef7649189e5197b90 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 1 Dec 2019 15:55:10 +1000 Subject: [PATCH] Improve some dinitctl error messages --- src/dinitctl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dinitctl.cc b/src/dinitctl.cc index b2af20b..c33d420 100644 --- a/src/dinitctl.cc +++ b/src/dinitctl.cc @@ -320,7 +320,8 @@ int main(int argc, char **argv) control_socket_path = control_socket_str.c_str(); } else { - cerr << "Cannot locate user home directory (set HOME or check /etc/passwd file)" << endl; + cerr << "dinitctl: Cannot locate user home directory (set HOME, check /etc/passwd file, or " + "specify socket path via -p)" << endl; return 1; } } @@ -328,7 +329,7 @@ int main(int argc, char **argv) int socknum = socket(AF_UNIX, SOCK_STREAM, 0); if (socknum == -1) { - perror("dinitctl: socket"); + perror("dinitctl: error opening socket"); return 1; } @@ -345,7 +346,7 @@ int main(int argc, char **argv) int connr = connect(socknum, (struct sockaddr *) name, sockaddr_size); if (connr == -1) { - perror("dinitctl: connect"); + perror((std::string("dinitctl: connecting to socket ") + control_socket_path).c_str()); return 1; } -- 2.25.1