Skip site navigation (1) Skip section navigation (2)

Re: Randomly placed definition of S_ISDIR() in psql/copy.c

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Randomly placed definition of S_ISDIR() in psql/copy.c
Date: 2009-04-26 06:51:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> Why does psql/copy.c contain this?
> #if defined(WIN32) && !defined(S_ISDIR)
> #define __S_ISTYPE(mode, mask)	(((mode) & S_IFMT) == (mask))
> #define S_ISDIR(mode)	 __S_ISTYPE((mode), S_IFDIR)
> #endif
> Surely a better place for such a thing is src/include/port/win32.h
> ... where indeed there already is a definition of S_ISDIR().
> So I think this is dead code as well as poor style.  Any objection to
> seeing what happens if we remove it?

I believe that code pre-dates the full win32 port, and is from the time
when we did just libpq + psql.

So, +1 on killing it.


In response to

pgsql-hackers by date

Next:From: Valtonen, HannuDate: 2009-04-26 10:00:54
Subject: Patch to add support for text/int arrays for plpythonu
Previous:From: tomasDate: 2009-04-26 06:05:27
Subject: Re: RFE: Transparent encryption on all fields

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group