diff mbox

[uclibc-ng-devel] test: inet: Fix warning messages

Message ID 1466507945-16421-1-git-send-email-Eugeniy.Paltsev@synopsys.com
State Accepted
Headers show

Commit Message

Eugeniy Paltsev June 21, 2016, 11:19 a.m. UTC
This patch is to address a proposal by Waldemar in this thread:
http://mailman.uclibc-ng.org/pipermail/devel/2016-June/001006.html
tst-ethers-line and tst-ethers require /etc/ethers to exist,
otherwise user should create it manually.
Add this info to warning message.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 test/inet/tst-ethers-line.c | 5 +++--
 test/inet/tst-ethers.c      | 6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

Comments

Waldemar Brodkorb June 26, 2016, 9:59 a.m. UTC | #1
Hi Eugenily,
Eugeniy Paltsev wrote,

> This patch is to address a proposal by Waldemar in this thread:
> http://mailman.uclibc-ng.org/pipermail/devel/2016-June/001006.html
> tst-ethers-line and tst-ethers require /etc/ethers to exist,
> otherwise user should create it manually.
> Add this info to warning message.
> 
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> ---
>  test/inet/tst-ethers-line.c | 5 +++--
>  test/inet/tst-ethers.c      | 6 +++++-
>  2 files changed, 8 insertions(+), 3 deletions(-)

Applied and pushed,
 thx
  Waldemar
diff mbox

Patch

diff --git a/test/inet/tst-ethers-line.c b/test/inet/tst-ethers-line.c
index 19cf2fb..182faf0 100644
--- a/test/inet/tst-ethers-line.c
+++ b/test/inet/tst-ethers-line.c
@@ -14,7 +14,8 @@ 
 #define ETHER_LINE_LEN 256
 
 /* This test requires /etc/ethers to exist
- * and to have nonzero length
+ * and to have nonzero length. You should create it manually,
+ * if it doesn't exist.
  */
 
 int main(void)
@@ -26,7 +27,7 @@  int main(void)
 	struct stat statb;
 
 	if ((fd = open(ETHER_FILE_NAME, O_RDONLY)) == -1) {
-		perror ("Cannot open file");
+		perror ("Cannot open file /etc/ethers");
 		exit(1);
 	}
 
diff --git a/test/inet/tst-ethers.c b/test/inet/tst-ethers.c
index 6b6e10c..f12813a 100644
--- a/test/inet/tst-ethers.c
+++ b/test/inet/tst-ethers.c
@@ -6,6 +6,8 @@ 
 /* This test requires /etc/ethers to exist
  * and to have host "teeth". For example:
  * 00:11:22:33:44:55 teeth
+ * You should create /etc/ethers file with
+ * host "teeth" manually, if it doesn't exist.
  */
 
 int main(void)
@@ -15,8 +17,10 @@  int main(void)
 	int i;
 	int res = ether_hostton("teeth", &addr);
 
-	if (res)
+	if (res) {
+		printf("Either /etc/ethers is missing or it has incorrect contents\n");
 		return 1;
+	}
 
 	for (i = 0; i < 6; i++) {
 		printf("%02x", addr.ether_addr_octet[i]);