[PATCH mkfontscale] Prefer original file over symlink (v2)

Egbert Eich eich at freedesktop.org
Fri Jan 11 09:18:37 PST 2013


> 
> Unfortunately, S_ISLNK isn't defined on MinGW (see [1]), so perhaps the
> attached is needed.

Ok.
> 
> [1] http://tinderbox.freedesktop.org/builds/2013-01-10-0020/logs/mkfontscale/
> 
> --- a/mkfontscale.c
> +++ b/mkfontscale.c
> @@ -850,8 +850,10 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
>  	{
>  	    if (lstat(filename, &f_stat))
>  		goto done;
> +#ifdef S_ISLNK
>  	    if (S_ISLNK(f_stat.st_mode))
>  		tprio = 0;
> +#endif

Unfortunately this defeats the prime purpose of calling lstat().
The only benefit it would bring is to determine early if there's an issue with
the file and bail.
I would therefore suggest

#ifdef  DT_LNK
       if (...) {
       	  ...         
       } else

#endif
#ifdef S_ISLNK
       {
	...
       }
#else
	;
#endif

If that's OK with you I will commit this.

Thanks!

Cheers,
	Egbert.


More information about the xorg-devel mailing list