Skip to contentSkip to conversation

Use errno instead of having unknown error

PATCH In review Luk Claes 2 participants 3 messages Jul 19, 2012 – Jul 20, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Luk Claes

author
#0 lore raw

PATCH 1/1 Use errno instead of having unknown error

When access() fails, use errno for a sensible error message.

---
 mount.cifs.c |    1 +
 1 file changed, 1 insertion(+)
mount.cifs.c +1 -0
index 6f3f382..f47f416 100644
@@ -590,6 +590,7 @@ static int open_cred_file(char *file_name,
 	i = access(file_name, R_OK);
 	if (i) {
 		toggle_dac_capability(0, 0);
+		i = errno;
 		goto return_i;
 	}
 
Signature · 1 line
1.7.10.4

A message that is not in the archive (sent off-list or not yet received): 1342690708-15087-1-git-send-email-luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 12 lines · On Thu, 19 Jul 2012 11:38:28 +0200 Luk Claes…

When access() fails, use errno for a sensible error message.

---
 mount.cifs.c |    1 +
 1 file changed, 1 insertion(+)
mount.cifs.c +0 -0
index 6f3f382..f47f416 100644

mount.cifs.c static int open_cred_file(char *file_name, · line 596

Quoted 7 lines
mount.cifs.c +1 -0
@@ -590,6 +590,7 @@ static int open_cred_file(char *file_name,
 	i = access(file_name, R_OK);
 	if (i) {
 		toggle_dac_capability(0, 0);
+		i = errno;
 		goto return_i;
 	}
 

Looks correct.

Thanks!

Signature · 1 line
Jeff Layton <[email protected]>
#3 lore raw
In reply to a message not in the archive
Quoted 12 lines · On Thu, 19 Jul 2012 11:38:28 +0200 Luk Claes…

When access() fails, use errno for a sensible error message.

---
 mount.cifs.c |    1 +
 1 file changed, 1 insertion(+)
mount.cifs.c +0 -0
index 6f3f382..f47f416 100644

mount.cifs.c static int open_cred_file(char *file_name, · line 596

Quoted 7 lines
mount.cifs.c +1 -0
@@ -590,6 +590,7 @@ static int open_cred_file(char *file_name,
 	i = access(file_name, R_OK);
 	if (i) {
 		toggle_dac_capability(0, 0);
+		i = errno;
 		goto return_i;
 	}
 

Merged...

Signature · 1 line
Jeff Layton <[email protected]>