git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0
@ 2022-09-16 23:04 rsbecker
  2022-09-16 23:11 ` Victoria Dye
  0 siblings, 1 reply; 4+ messages in thread
From: rsbecker @ 2022-09-16 23:04 UTC (permalink / raw)
  To: 'Git Mailing List'

The dirent d_type field is not available on every system. This was
introduced at 2.38.0-rc0 in diagnose.c

diagnose.c, line 79: error(1565): struct "dirent" has no field "d_type"

  		    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&

(3 more issues in diagnose exist of this form).

The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is
an existing field as defined in cache.h.

This change breaks the build on NonStop systems (at least). I'm sorry I
missed this during review.

Randall

--
Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)
NonStop(211288444200000000)
-- In real life, I talk too much.




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

* Re: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0
  2022-09-16 23:04 [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0 rsbecker
@ 2022-09-16 23:11 ` Victoria Dye
  2022-09-16 23:14   ` rsbecker
  2022-09-17  0:46   ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Victoria Dye @ 2022-09-16 23:11 UTC (permalink / raw)
  To: rsbecker, 'Git Mailing List'

rsbecker@nexbridge.com wrote:
> The dirent d_type field is not available on every system. This was
> introduced at 2.38.0-rc0 in diagnose.c
> 
> diagnose.c, line 79: error(1565): struct "dirent" has no field "d_type"
> 
>   		    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&
> 
> (3 more issues in diagnose exist of this form).
> 
> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is
> an existing field as defined in cache.h.

Apologies for missing that, I'll try to send a patch fixing it either later
today or sometime Monday.

Thanks,
-Victoria

> 
> This change breaks the build on NonStop systems (at least). I'm sorry I
> missed this during review.
> 
> Randall
> 
> --
> Brief whoami: NonStop&UNIX developer since approximately
> UNIX(421664400)
> NonStop(211288444200000000)
> -- In real life, I talk too much.
> 
> 
> 


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

* RE: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0
  2022-09-16 23:11 ` Victoria Dye
@ 2022-09-16 23:14   ` rsbecker
  2022-09-17  0:46   ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: rsbecker @ 2022-09-16 23:14 UTC (permalink / raw)
  To: 'Victoria Dye', 'Git Mailing List'

On September 16, 2022 7:11 PM, Victoria Dye wrote:
>rsbecker@nexbridge.com wrote:
>> The dirent d_type field is not available on every system. This was
>> introduced at 2.38.0-rc0 in diagnose.c
>>
>> diagnose.c, line 79: error(1565): struct "dirent" has no field "d_type"
>>
>>   		    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&
>>
>> (3 more issues in diagnose exist of this form).
>>
>> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether
>> this is an existing field as defined in cache.h.
>
>Apologies for missing that, I'll try to send a patch fixing it either later today or
>sometime Monday.

Thanks. If you need it tested in advance "in the wild", please let me know.

Regards,
Randall


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

* Re: [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0
  2022-09-16 23:11 ` Victoria Dye
  2022-09-16 23:14   ` rsbecker
@ 2022-09-17  0:46   ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2022-09-17  0:46 UTC (permalink / raw)
  To: Victoria Dye; +Cc: rsbecker, 'Git Mailing List'

Victoria Dye <vdye@github.com> writes:

> rsbecker@nexbridge.com wrote:
>> The dirent d_type field is not available on every system. This was
>> introduced at 2.38.0-rc0 in diagnose.c
>> 
>> diagnose.c, line 79: error(1565): struct "dirent" has no field "d_type"
>> 
>>   		    e->d_type == DT_DIR && strlen(e->d_name) == 2 &&
>> 
>> (3 more issues in diagnose exist of this form).
>> 
>> The code should use the  NO_D_TYPE_IN_DIRENT knob to detect whether this is
>> an existing field as defined in cache.h.

Also, even if d_type member exists in the dirent struct, the value
can be DT_UNKNOWN and the code should be prepared to fall back to do
lstat() on the path in such a case.

dir.c::resolve_dtype() can be looked at for inspiration but only for
inspiration and not for copying (because it is about tracked working
tree paths, the function does a lot more than what diagnose.c wants
to).

> Apologies for missing that, I'll try to send a patch fixing it either later
> today or sometime Monday.

Thanks, both of you.


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

end of thread, other threads:[~2022-09-17  0:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 23:04 [BUG] Non-portable Construct Introduced in diagnose.c (dirent) at v2.38.0-rc0 rsbecker
2022-09-16 23:11 ` Victoria Dye
2022-09-16 23:14   ` rsbecker
2022-09-17  0:46   ` Junio C Hamano

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).