[RFC PATCH 6/6] test-dir-iterator: handle EACCES errno by dir-iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Handle EACCES errno returned by dir_iterator_begin() by printing the
"EACCES" string instead of printing "ESOMETHINGELSE".

Signed-off-by: Plato Kiorpelidis <kioplato@xxxxxxxxx>
---
 t/helper/test-dir-iterator.c | 8 +++++---
 t/t0066-dir-iterator.sh      | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c
index c92616bd69..fd07429f90 100644
--- a/t/helper/test-dir-iterator.c
+++ b/t/helper/test-dir-iterator.c
@@ -7,9 +7,11 @@
 static const char *error_name(int error_number)
 {
 	switch (error_number) {
-	case ENOENT: return "ENOENT";
-	case ENOTDIR: return "ENOTDIR";
-	default: return "ESOMETHINGELSE";
+		case ENOENT: return "ENOENT";
+		case ENOTDIR: return "ENOTDIR";
+		case EACCES: return "EACCES";
+
+		default: return "ESOMETHINGELSE";
 	}
 }
 
diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh
index 974bb13092..4bf6456735 100755
--- a/t/t0066-dir-iterator.sh
+++ b/t/t0066-dir-iterator.sh
@@ -861,7 +861,7 @@ test_expect_success POSIXPERM,SANITY \
 
 
 	cat >expected-no-permissions-out <<-EOF &&
-	dir_iterator_begin failure: ESOMETHINGELSE
+	dir_iterator_begin failure: EACCES
 	EOF
 
 	test_must_fail test-tool dir-iterator ./dir12 >actual-out &&
-- 
2.35.1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux