Require POSIX.1 (1990) compliance on unix

Assume unix platforms support the original POSIX.1 standard.
Specifically, assume that if G_OS_UNIX, then we have chown(),
getcwd(), getgrgid(), getpwuid(), link(), <grp.h>, <pwd.h>,
<sys/types.h>, <sys/uio.h>, <sys/wait.h>, and <unistd.h>.

Additionally, since all versions of Windows that we care about also
have <sys/types.h>, we can remove HAVE_SYS_TYPES_H checks everywhere.

Also remove one include of <sys/times.h>, and the corresponding
configure check, since the include is not currently needed (and may
always have just been a typo for <sys/time.h>).

https://bugzilla.gnome.org/show_bug.cgi?id=710519
This commit is contained in:
Dan Winship
2013-10-19 13:03:59 -04:00
parent 6e4a7fca43
commit 3981cddbf8
13 changed files with 38 additions and 99 deletions

View File

@@ -29,6 +29,7 @@
*/
#include "config.h"
#include "glibconfig.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -42,7 +43,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_PWD_H
#ifdef G_OS_UNIX
#include <pwd.h>
#endif
#include <sys/types.h>
@@ -603,7 +604,7 @@ g_get_user_database_entry (void)
{
static UserDatabaseEntry e;
#ifdef HAVE_PWD_H
#ifdef G_OS_UNIX
{
struct passwd *pw = NULL;
gpointer buffer = NULL;
@@ -718,7 +719,7 @@ g_get_user_database_entry (void)
g_free (buffer);
}
#else /* !HAVE_PWD_H */
#endif /* G_OS_UNIX */
#ifdef G_OS_WIN32
{
@@ -733,8 +734,6 @@ g_get_user_database_entry (void)
}
#endif /* G_OS_WIN32 */
#endif /* !HAVE_PWD_H */
if (!e.user_name)
e.user_name = g_strdup ("somebody");
if (!e.real_name)