about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-12-25 18:41:21 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-12-25 18:41:21 +0100
commit96da54bb23f520def7f7f6d38ec45d90c77fcd06 (patch)
tree5d9f5083153f74dba6e50aac0472f652188c24d3
parent7c2b6f3d3dd2c3a44293bfa60d1e44cf8720e420 (diff)
downloadnitro-96da54bb23f520def7f7f6d38ec45d90c77fcd06.tar.gz
nitro-96da54bb23f520def7f7f6d38ec45d90c77fcd06.tar.xz
nitro-96da54bb23f520def7f7f6d38ec45d90c77fcd06.zip
nitroctl: better error messages
-rw-r--r--nitroctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nitroctl.c b/nitroctl.c
index 0db39e7..9dce603 100644
--- a/nitroctl.c
+++ b/nitroctl.c
@@ -71,7 +71,7 @@ again:
 	addr.sun_family = AF_UNIX;
 	strncpy(addr.sun_path, sockpath, sizeof addr.sun_path - 1);
 	if (connect(connfd, (struct sockaddr *)&addr, sizeof addr) < 0) {
-		perror("connect");
+		fprintf(stderr, "nitroctl: could not connect to '%s', is nitro started?\n", sockpath);
 		exit(111);
 	}
 }
@@ -103,13 +103,13 @@ send_and_wait(char cmd, const char *service)
 		}
 
 		buf[rd] = 0;
-		printf("got %s\n", buf);
 
 		int state = 0;
 		if (buf[0] >= 'A' && buf[0] <= 'Z')
 			state = buf[0] - 64;
 
 		if (buf[0] == 'e') {
+			fprintf(stderr, "nitroctl: no such service '%s'\n", service);
 			return 111;
 		}