diff options
author | Colin Walters <walters@verbum.org> | 2012-12-03 14:26:49 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-12-03 17:16:40 -0500 |
commit | 89fa2a2333d64261369610a55f95341e0a321093 (patch) | |
tree | ee84067d6c35bd67d447edb82ed6d4674a474048 | |
parent | 03dc53b111d2aeeca15dcacac8bb22f8a21fe118 (diff) | |
download | gdm-89fa2a2333d64261369610a55f95341e0a321093.tar.gz |
gdm-common: Drop some dead code
-unknown-origin.[ch] according to ChangeLog was about copyright
status...but the file clearly has a copyright header now, so
presumably this is just long dead history.
Nothing was using gdm_safe_fopen_w(). After deleting that, we're left
with VE_IGNORE_EINTR(), which is now just in gdm-common.h
https://bugzilla.gnome.org/show_bug.cgi?id=689569
-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 | 7 |
4 files changed, 6 insertions, 78 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index 8bbe9c53..1534ccb4 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -67,8 +67,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 1a0c2583..7c72990a 100644 --- a/common/gdm-common.h +++ b/common/gdm-common.h @@ -23,8 +23,13 @@ #include <glib.h> #include <pwd.h> +#include <errno.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" |