diff options
-rw-r--r-- | common/Makefile.am | 2 | ||||
-rw-r--r-- | common/gdm-common-unknown-origin.c | 66 | ||||
-rw-r--r-- | common/gdm-common-unknown-origin.h | 9 | ||||
-rw-r--r-- | common/gdm-common.h | 6 |
4 files changed, 5 insertions, 78 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index 5688d388..c28d9b28 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -53,8 +53,6 @@ libgdmcommon_la_SOURCES = \ gdm-address.c \ gdm-common.h \ gdm-common.c \ - gdm-common-unknown-origin.h \ - gdm-common-unknown-origin.c \ gdm-profile.c \ gdm-profile.h \ gdm-settings.c \ diff --git a/common/gdm-common-unknown-origin.c b/common/gdm-common-unknown-origin.c deleted file mode 100644 index 8a7849d6..00000000 --- a/common/gdm-common-unknown-origin.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * (c) 2000 Eazel, Inc. - * (c) 2001,2002 George Lebl - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" - -#include <string.h> -#include <unistd.h> -#include <stdlib.h> -#include <locale.h> -#include <fcntl.h> -#include <sys/types.h> - -#include <glib.h> -#include <glib/gi18n.h> -#include <glib/gstdio.h> - -#include "gdm-common.h" - -/* Like fopen with "w" */ -FILE * -gdm_safe_fopen_w (const char *file, - mode_t perm) -{ - int fd; - FILE *ret; - VE_IGNORE_EINTR (g_unlink (file)); - do { - int flags; - - errno = 0; - flags = O_EXCL | O_CREAT | O_TRUNC | O_WRONLY; -#ifdef O_NOCTTY - flags |= O_NOCTTY; -#endif -#ifdef O_NOFOLLOW - flags |= O_NOFOLLOW; -#endif - - fd = g_open (file, flags, perm); - } while (errno == EINTR); - - if (fd < 0) { - return NULL; - } - - ret = fdopen (fd, "w"); - return ret; -} diff --git a/common/gdm-common-unknown-origin.h b/common/gdm-common-unknown-origin.h index a87e38ab..30dbcca4 100644 --- a/common/gdm-common-unknown-origin.h +++ b/common/gdm-common-unknown-origin.h @@ -29,15 +29,6 @@ G_BEGIN_DECLS -#define VE_IGNORE_EINTR(expr) \ - do { \ - errno = 0; \ - expr; \ - } while G_UNLIKELY (errno == EINTR); - -/* like fopen with "w" but unlinks and uses O_EXCL */ -FILE * gdm_safe_fopen_w (const char *file, - mode_t perm); G_END_DECLS diff --git a/common/gdm-common.h b/common/gdm-common.h index f1e945bf..5e1da5d9 100644 --- a/common/gdm-common.h +++ b/common/gdm-common.h @@ -24,7 +24,11 @@ #include <glib-unix.h> #include <pwd.h> -#include "gdm-common-unknown-origin.h" +#define VE_IGNORE_EINTR(expr) \ + do { \ + errno = 0; \ + expr; \ + } while G_UNLIKELY (errno == EINTR); #define GDM_CUSTOM_SESSION "custom" |