bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [Mingw-users] Re: More patch 2.5.9 hacking


From: Manu
Subject: Re: [Mingw-users] Re: More patch 2.5.9 hacking
Date: Fri, 24 Oct 2003 22:28:28 +0200

Hi,

Paul Eggert wrote:
> "manubee" <address@hidden> writes:
> 
> > >> +#ifdef __MINGW32__
> > >> +        mkdir (filename);
> > >> +#else
> > >> +        mkdir (filename,
> > >> +           S_IRUSR|S_IWUSR|S_IXUSR
> > >> +           |S_IRGRP|S_IWGRP|S_IXGRP
> > >> +           |S_IROTH|S_IWOTH|S_IXOTH);
> > >> +#endif
> > >
> > Apparently nobody reads what I'm posting, I'd rather go fishing :)
> > I've already submitted a patch for this.
> > I had no reply.
> 
> If the patch is what is quoted above, then it's not the right patch
> for reasons that Eli Zaretskii already mentioned: we want to avoid
> putting '#ifdef __MINGW32__' in the mainline code.

200% agreed. The changes above are not from me.
 
> If it's some other patch then I must have missed it; sorry.

Here it is:
http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00168.html

> > The mkdir.m4 macro just _DOESN'T_WORK_. It always returns "no",
> > while it should return "yes" under Windows.
> 
> Then the right thing to do is to fix the mkdir.m4 macro.  Why
> isn't it working?
> 
> mkdir.m4 tries to compile both (mkdir (".", 0)) and (mkdir (".")).  If
> the latter compiles but the former does not, mkdir.m4 concludes that
> mkdir has only one argument.  What is wrong with that method?

Here's mine:
#serial 1

dnl From Mumit Khan and Paul Eggert
dnl Determine whether mkdir accepts only one argument instead of the usual two.

AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
  [AC_CHECK_FUNCS(mkdir)
   AC_CACHE_CHECK([whether mkdir takes only one argument],
     patch_cv_mkdir_takes_one_arg,
     [patch_cv_mkdir_takes_one_arg=no
      if test $ac_cv_func_mkdir = yes; then
 AC_TRY_COMPILE([
#include <dir.h>
   ],
   [mkdir (".");],
   patch_cv_mkdir_takes_one_arg=yes,
   patch_cv_mkdir_takes_one_arg=no
   )
      fi
     ]
   )
   if test $patch_cv_mkdir_takes_one_arg = yes; then
     AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
       [Define if mkdir takes only one argument.])
   fi
  ]
)

It compiles only once.

I checked that under Unix it returns "no" and under
Windows "yes". That version works just fine and is a
bit simplest as the original. Please merge :)

Then, an mkdir wrapper already exits in common.h,
unfortunately, it is useless, since declared before
"# include <unistd.h>".
(mkdir is line 71 and uses the variable defined from mkdir.m4,
the include is line 221)

I've attached my files again for your convenience.

Now, I also tried to move all the mkdir stuff into pc/mingw but
I had no success. It is not like substituting the implementation of
two functions, here it is the declaration of the function that cause
trouble. I don't know yet how to fix that from a sub-directory.

Manu.


Attachment: ChangeLog
Description: Binary data

Attachment: patch.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]