git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount., 
@ 2006-02-02  0:39 Jason Riedy
  2006-02-02  0:46 ` [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount Junio C Hamano
  2006-02-02  4:18 ` H. Peter Anvin
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Riedy @ 2006-02-02  0:39 UTC (permalink / raw)
  To: git

I guess our home directories recently were changed from symlinks
to autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied
to these, breaking safe_create_leading_directories.  I don't
know if ENOSYS is available everywhere, or if this odd behavior
is appropriate everywhere.

This works for me, but should I wrap mkdir for bizarre behavior
by adding a compat/gitmkdir.c?

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>

---

 sha1_file.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

4f388cf48271ec1547817a407ef1afe432cd59d4
diff --git a/sha1_file.c b/sha1_file.c
index 20f6419..65407e2 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -83,7 +83,15 @@ int safe_create_leading_directories(char
 			break;
 		*pos = 0;
 		if (mkdir(path, 0777) < 0) {
+#if !defined(ENOSYS)
 			if (errno != EEXIST) {
+#else
+			if (errno != EEXIST && errno != ENOSYS) {
+#endif
+/* 
+ * Solaris 8 appears to return ENOSYS when mkdir is applied 
+ * to an automount.
+ */
 				*pos = '/';
 				return -1;
 			}
-- 
1.1.6.g7159

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.
  2006-02-02  0:39 [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount., Jason Riedy
@ 2006-02-02  0:46 ` Junio C Hamano
  2006-02-02  4:14   ` Jason Riedy
  2006-02-02  4:18 ` H. Peter Anvin
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2006-02-02  0:46 UTC (permalink / raw)
  To: Jason Riedy; +Cc: git

Jason Riedy <ejr@EECS.Berkeley.EDU> writes:

> I guess our home directories recently were changed from symlinks
> to autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied
> to these, breaking safe_create_leading_directories.  I don't
> know if ENOSYS is available everywhere, or if this odd behavior
> is appropriate everywhere.
>
> This works for me, but should I wrap mkdir for bizarre behavior
> by adding a compat/gitmkdir.c?

There was a similar patch for working around Cygwin that threw
different errno in an earlier thread:

    From: Alex Riesen <raa.lkml@gmail.com>
    Subject: [PATCH] Set errno to EEXIST if mkdir returns EACCES or EPERM

Somehow I started to trust your ability to code portably a lot
better than I trust myself, so please first disregard the
suggestion I gave in that thread and give me your honest opinion
on what the right fix/workaround would be.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.
  2006-02-02  0:46 ` [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount Junio C Hamano
@ 2006-02-02  4:14   ` Jason Riedy
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Riedy @ 2006-02-02  4:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

And Junio C Hamano writes:
 - There was a similar patch for working around Cygwin that threw
 - different errno in an earlier thread:

Thanks.  The thread mentioned in that one seems to have a few
"right" solutions.  A compat/gitmkdirat.c likely is the best,
modelled after the gnulib one.  I'll look at it when I can in 
the next week or so, so you can ignore my patch.

 - Somehow I started to trust your ability to code portably a lot
 - better than I trust myself, [...]

eep.  ;)  I only have access to three major variations at the
moment (Linux, semi-old Solaris, recent AIX), so I'm not an
authority...  Solaris 8 is from before the general Linux/glibc 
compatability movement, so it's pretty useful for testing.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:
  2006-02-02  0:39 [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount., Jason Riedy
  2006-02-02  0:46 ` [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount Junio C Hamano
@ 2006-02-02  4:18 ` H. Peter Anvin
  1 sibling, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2006-02-02  4:18 UTC (permalink / raw)
  To: Jason Riedy; +Cc: git

Jason Riedy wrote:
> I guess our home directories recently were changed from symlinks
> to autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied
> to these, breaking safe_create_leading_directories.  I don't
> know if ENOSYS is available everywhere, or if this odd behavior
> is appropriate everywhere.
> 
> This works for me, but should I wrap mkdir for bizarre behavior
> by adding a compat/gitmkdir.c?

Wow, Solaris really can be braindamaged sometimes...

	-hpa

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-02  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-02  0:39 [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount., Jason Riedy
2006-02-02  0:46 ` [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount Junio C Hamano
2006-02-02  4:14   ` Jason Riedy
2006-02-02  4:18 ` H. Peter Anvin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).