{"thread":{"id":"3215","subject":"[RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.","startedAt":"2006-02-02T00:39:22Z","lastAt":"2006-02-02T04:18:50Z","messageCount":4,"participants":["Jason Riedy","Junio C Hamano","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"15453","messageId":"24768.1138840762@lotus.CS.Berkeley.EDU","threadId":"3215","inReplyTo":null,"subject":"[RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.","fromName":"Jason Riedy","fromEmail":"ejr@eecs.berkeley.edu","sentAt":"2006-02-02T00:39:22Z","receivedAt":"2006-02-02T00:39:22Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"I guess our home directories recently were changed from symlinks\nto autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied\nto these, breaking safe_create_leading_directories.  I don't\nknow if ENOSYS is available everywhere, or if this odd behavior\nis appropriate everywhere.\n\nThis works for me, but should I wrap mkdir for bizarre behavior\nby adding a compat/gitmkdir.c?\n\nSigned-off-by: Jason Riedy <ejr@cs.berkeley.edu>\n\n---\n\n sha1_file.c |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\n4f388cf48271ec1547817a407ef1afe432cd59d4\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 20f6419..65407e2 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -83,7 +83,15 @@ int safe_create_leading_directories(char\n \t\t\tbreak;\n \t\t*pos = 0;\n \t\tif (mkdir(path, 0777) < 0) {\n+#if !defined(ENOSYS)\n \t\t\tif (errno != EEXIST) {\n+#else\n+\t\t\tif (errno != EEXIST && errno != ENOSYS) {\n+#endif\n+/* \n+ * Solaris 8 appears to return ENOSYS when mkdir is applied \n+ * to an automount.\n+ */\n \t\t\t\t*pos = '/';\n \t\t\t\treturn -1;\n \t\t\t}\n-- \n1.1.6.g7159\n"},{"id":"15454","messageId":"7vwtge37w5.fsf@assigned-by-dhcp.cox.net","threadId":"3215","inReplyTo":"24768.1138840762@lotus.CS.Berkeley.EDU","subject":"Re: [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-02T00:46:02Z","receivedAt":"2006-02-02T00:46:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Riedy <ejr@EECS.Berkeley.EDU> writes:\n\n> I guess our home directories recently were changed from symlinks\n> to autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied\n> to these, breaking safe_create_leading_directories.  I don't\n> know if ENOSYS is available everywhere, or if this odd behavior\n> is appropriate everywhere.\n>\n> This works for me, but should I wrap mkdir for bizarre behavior\n> by adding a compat/gitmkdir.c?\n\nThere was a similar patch for working around Cygwin that threw\ndifferent errno in an earlier thread:\n\n    From: Alex Riesen <raa.lkml@gmail.com>\n    Subject: [PATCH] Set errno to EEXIST if mkdir returns EACCES or EPERM\n\nSomehow I started to trust your ability to code portably a lot\nbetter than I trust myself, so please first disregard the\nsuggestion I gave in that thread and give me your honest opinion\non what the right fix/workaround would be.\n"},{"id":"15462","messageId":"25920.1138853640@lotus.CS.Berkeley.EDU","threadId":"3215","inReplyTo":"7vwtge37w5.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC & PATCH] Solaris 8: ENOSYS when mkdir applied to automount.","fromName":"Jason Riedy","fromEmail":"ejr@eecs.berkeley.edu","sentAt":"2006-02-02T04:14:00Z","receivedAt":"2006-02-02T04:14:00Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"And Junio C Hamano writes:\n - There was a similar patch for working around Cygwin that threw\n - different errno in an earlier thread:\n\nThanks.  The thread mentioned in that one seems to have a few\n\"right\" solutions.  A compat/gitmkdirat.c likely is the best,\nmodelled after the gnulib one.  I'll look at it when I can in \nthe next week or so, so you can ignore my patch.\n\n - Somehow I started to trust your ability to code portably a lot\n - better than I trust myself, [...]\n\neep.  ;)  I only have access to three major variations at the\nmoment (Linux, semi-old Solaris, recent AIX), so I'm not an\nauthority...  Solaris 8 is from before the general Linux/glibc \ncompatability movement, so it's pretty useful for testing.\n\nJason\n"},{"id":"15463","messageId":"43E1882A.307@zytor.com","threadId":"3215","inReplyTo":"24768.1138840762@lotus.CS.Berkeley.EDU","subject":"Re:","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2006-02-02T04:18:50Z","receivedAt":"2006-02-02T04:18:50Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Jason Riedy wrote:\n> I guess our home directories recently were changed from symlinks\n> to autmounts.  Solaris 8's mkdir(2) returns ENOSYS when applied\n> to these, breaking safe_create_leading_directories.  I don't\n> know if ENOSYS is available everywhere, or if this odd behavior\n> is appropriate everywhere.\n> \n> This works for me, but should I wrap mkdir for bizarre behavior\n> by adding a compat/gitmkdir.c?\n\nWow, Solaris really can be braindamaged sometimes...\n\n\t-hpa\n"}]}