delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2014/04/30/14:16:29

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=74Q9iN0C6loXFiwmfbZdsTEfyE8Gyp7NKl2PyuuV/mI=;
b=HAVetLwpme9/4s7Tpmfg9d9r6xH3oK3wVAKrE2MJWcM5EAAwd19cTSOXdwOAgT9/x4
ejcC6gEDyt5RETb2dUwjwNPTes3iGb5nOXxPvppMLiw3mZ+NOgwqkGpel99lrIJC/WwM
BhMgmBNVPMGs7jBQPjetVw4J2vpbzqzrG3ynRJ8YlPMgKfrYReBvZkuRQzjOpe8HxuRx
QPe16fQ9GGgPJmHLSp/9gbgFMP05cdSjy7iKFBgMI9PsIgkAZxYG7Lp3o66fx6JWQm4M
sM4DjLbd1FuWwJsDcNZFCJRrglXxAJu+jMKY4pzOWH9YzWIl3Bt/tWVN9lhNRxCAFl4Y
wmUg==
MIME-Version: 1.0
X-Received: by 10.50.49.44 with SMTP id r12mr40177500ign.41.1398881777827;
Wed, 30 Apr 2014 11:16:17 -0700 (PDT)
In-Reply-To: <CAA2C=vCsFzQ9mip4ZTxL8+UPpqbZUQdX=ZDqzTK3V7zbgKm95g@mail.gmail.com>
References: <CAA2C=vBuWHmVNrRAcGDSXYLc8Eg_xsyMVszPzrxqHGrpVq2vmw AT mail DOT gmail DOT com>
<83wqeh9pwq DOT fsf AT gnu DOT org>
<CAA2C=vD_97x3-A0Y52JDfbmmFiuVzF_Ufub6imhmuhTsdsNr4w AT mail DOT gmail DOT com>
<83vbu19o4f DOT fsf AT gnu DOT org>
<CAA2C=vDAWcPpCex4koZXSdorEid7w1=QTAWip7t0n-exMH+vrQ AT mail DOT gmail DOT com>
<83r44p9mjr DOT fsf AT gnu DOT org>
<CAA2C=vBWH49B_zu-1rAqxBvHoxKzZL+pqOANTE0H3MPQ2OkROg AT mail DOT gmail DOT com>
<CAA2C=vD-a_Tx+ZzseEuZU_-U7eJYEsLFNwWVdKLmm85_7_N9qA AT mail DOT gmail DOT com>
<83r44elogs DOT fsf AT gnu DOT org>
<CAA2C=vCsFzQ9mip4ZTxL8+UPpqbZUQdX=ZDqzTK3V7zbgKm95g AT mail DOT gmail DOT com>
Date: Wed, 30 Apr 2014 21:16:17 +0300
Message-ID: <CAA2C=vBVyj-bSVVwJAxMRQEykKPy8wzh1EQRz+sm54dhCe-1VQ@mail.gmail.com>
Subject: Re: [PATCH] break xstat.c into pieces
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 4/30/14, Eli Zaretskii <eliz AT gnu DOT org> wrote:
>> Date: Wed, 30 Apr 2014 19:50:29 +0300
>> From: Ozkan Sezer <sezeroz AT gmail DOT com>
>>
>> On 4/22/14, Ozkan Sezer <sezeroz AT gmail DOT com> wrote:
>> > On 4/22/14, Eli Zaretskii <eliz AT gnu DOT org> wrote:
>> [...]
>> > OK, leaving things to you guys.
>> >
>>
>> PING:
>>
>> If there is still interest in this
>
> The interest never dwindled, thanks for persevering.
>
>> I've been using the two patches inlined below (also attached) for
>> some time and they work well for me.
>>
>>
>> * mkdir.c: replace access() call with _chmod(). this loses the extra
>> _fixpath()+remote rootdir check done by access(), but it shortens
>> things by not pulling in extra dependencies.
>
> What does this set errno to when the argument is "C:/" or some other
> root directory?
>

#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
int main () {
   if (mkdir("C:",0755)<0) printf("C:  -> errno: %d\n",errno);
   if (mkdir("C:\\",0755)<0) printf("C:\\ -> errno: %d\n",errno);
   if (mkdir("C:/",0755)<0) printf("C:/ -> errno: %d\n",errno);
   if (mkdir(".",0755)<0) printf(". -> errno: %d\n",errno);
   if (mkdir("hexen2",0755)<0) printf("hexen2  -> errno: %d\n",errno);
   if (mkdir("hexen2\\",0755)<0) printf("hexen2\\ -> errno: %d\n",errno);
   return 0;
}

Running the exe from C:\ prints the following:

Under dosbox:

C:  -> errno: 10
C:\ -> errno: 22
C:/ -> errno: 10
. -> errno: 10
hexen2  -> errno: 10
hexen2\ -> errno: 22


Under dosemu:

C:  -> errno: 10
C:\ -> errno: 10
C:/ -> errno: 10
. -> errno: 10
hexen2  -> errno: 10
hexen2\ -> errno: 10

EDIT: Forgot to mention that the results are the same with and without
the patch.

(Can't run under pure real dos at the moment.)

>> --- /dev/null
>> +++ src/libc/posix/sys/stat/statbits.c       24 Apr 2014 07:51:10 -0000
>
> I really don't see why a single short variable should have its own
> source file.

That would be you, but not me,

>   I think I suggested to add the variable to crt1.c.
> Could you please do that instead?

No, that won't be my suggestion. I can't see how a 500% irrelevant
flag var can go into crt1.c.  Feel free to do so yourself, though.

Regards.

--
O.S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019