diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-10-16 01:20:31 +0000 |
---|---|---|
committer | William Jon McCann <mccann@src.gnome.org> | 2007-10-16 01:20:31 +0000 |
commit | ecd0fe8580f2a8dc676adc384dcbbeca513df5bb (patch) | |
tree | 77a2a1d2e9afa5ebbbe776d9a9c89dd4aa574b15 | |
parent | 4c5e4c29799ff06484b5ab8471aa2c32f0699e70 (diff) | |
download | gdm-ecd0fe8580f2a8dc676adc384dcbbeca513df5bb.tar.gz |
Remove unused file.
2007-10-15 William Jon McCann <mccann@jhu.edu>
* daemon/Makefile.am:
* daemon/fstype.c:
Remove unused file.
svn path=/trunk/; revision=5370
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | daemon/Makefile.am | 4 | ||||
-rw-r--r-- | daemon/fstype.c | 423 | ||||
-rw-r--r-- | po/ChangeLog | 13 | ||||
-rw-r--r-- | po/POTFILES.in | 1 |
5 files changed, 11 insertions, 436 deletions
@@ -1,5 +1,11 @@ 2007-10-15 William Jon McCann <mccann@jhu.edu> + * daemon/Makefile.am: + * daemon/fstype.c: + Remove unused file. + +2007-10-15 William Jon McCann <mccann@jhu.edu> + * HACKING: * README: Add some more info. diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3fe280d4..d59ee648 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -102,7 +102,6 @@ gdm_simple_slave_SOURCES = \ gdm-simple-slave.h \ auth.c \ auth.h \ - fstype.c \ $(NULL) gdm_simple_slave_LDFLAGS = \ @@ -131,7 +130,6 @@ gdm_factory_slave_SOURCES = \ gdm-slave.h \ gdm-factory-slave.c \ gdm-factory-slave.h \ - fstype.c \ $(NULL) gdm_factory_slave_LDFLAGS = \ @@ -157,7 +155,6 @@ gdm_product_slave_SOURCES = \ gdm-product-slave.h \ auth.c \ auth.h \ - fstype.c \ $(NULL) gdm_product_slave_LDFLAGS = \ @@ -213,7 +210,6 @@ gdm_binary_SOURCES = \ gdm-slave-proxy.h \ auth.c \ auth.h \ - fstype.c \ $(NULL) XDMCP_SOURCES = \ diff --git a/daemon/fstype.c b/daemon/fstype.c deleted file mode 100644 index 84936ab1..00000000 --- a/daemon/fstype.c +++ /dev/null @@ -1,423 +0,0 @@ -/* fstype.c -- determine type of filesystems that files are on - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* This code was relicensed by the FSF on May 1 2002 - - This file 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 file 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 the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ -/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ - -#include "config.h" - -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <errno.h> -#ifdef STDC_HEADERS -#include <stdlib.h> -#else -extern int errno; -#endif -#include <string.h> -#ifdef HAVE_LIBGEN_H -#include <libgen.h> -#endif - -#if __STDC__ -# define P_(s) s -#else -# define P_(s) () -#endif - -static char *filesystem_type_uncached P_((char *path, char *relpath, struct stat *statp)); - -void fstype_internal_error (int level, int num, char const *fmt, ...); - -#ifdef FSTYPE_MNTENT /* 4.3BSD etc. */ -static int xatoi P_((char *cp)); -#endif - -#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ -#include <mntent.h> -#if !defined(MOUNTED) -# if defined(MNT_MNTTAB) /* HP-UX. */ -# define MOUNTED MNT_MNTTAB -# endif -# if defined(MNTTABNAME) /* Dynix. */ -# define MOUNTED MNTTABNAME -# endif -#endif -#endif - -#ifdef FSTYPE_GETMNT /* Ultrix. */ -#include <sys/param.h> -#include <sys/mount.h> -#include <sys/fs_types.h> -#endif - -#ifdef FSTYPE_USG_STATFS /* SVR3. */ -#include <sys/statfs.h> -#include <sys/fstyp.h> -#endif - -#ifdef FSTYPE_STATVFS /* SVR4. */ -#include <sys/statvfs.h> -#include <sys/fstyp.h> -#endif - -#ifdef FSTYPE_STATFS /* 4.4BSD. */ -#include <sys/param.h> /* NetBSD needs this. */ -#include <sys/mount.h> - -#ifndef MFSNAMELEN /* NetBSD defines this. */ -static char * -fstype_to_string (t) - short t; -{ -#ifdef INITMOUNTNAMES /* Defined in 4.4BSD, not in NET/2. */ - static char *mn[] = INITMOUNTNAMES; - if (t >= 0 && t <= MOUNT_MAXTYPE) - return mn[t]; - else - return "?"; -#else /* !INITMOUNTNAMES */ - switch (t) - { - case MOUNT_UFS: - return "ufs"; - case MOUNT_NFS: - return "nfs"; -#ifdef MOUNT_PC - case MOUNT_PC: - return "pc"; -#endif -#ifdef MOUNT_MFS - case MOUNT_MFS: - return "mfs"; -#endif -#ifdef MOUNT_LO - case MOUNT_LO: - return "lofs"; -#endif -#ifdef MOUNT_TFS - case MOUNT_TFS: - return "tfs"; -#endif -#ifdef MOUNT_TMP - case MOUNT_TMP: - return "tmp"; -#endif -#ifdef MOUNT_MSDOS - case MOUNT_MSDOS: - return "msdos"; -#endif -#ifdef MOUNT_ISO9660 - case MOUNT_ISO9660: - return "iso9660fs"; -#endif - default: - return "?"; - } -#endif /* !INITMOUNTNAMES */ -} -#endif /* !MFSNAMELEN */ -#endif /* FSTYPE_STATFS */ - -#ifdef FSTYPE_AIX_STATFS /* AIX. */ -#include <sys/vmount.h> -#include <sys/statfs.h> - -#define FSTYPE_STATFS /* Otherwise like 4.4BSD. */ -#define f_type f_vfstype - -static char * -fstype_to_string (t) - short t; -{ - switch (t) - { - case MNT_AIX: -#if 0 /* NFS filesystems are actually MNT_AIX. */ - return "aix"; -#endif - case MNT_NFS: - return "nfs"; - case MNT_JFS: - return "jfs"; - case MNT_CDROM: - return "cdrom"; - default: - return "?"; - } -} -#endif /* FSTYPE_AIX_STATFS */ - -#ifdef AFS -#include <netinet/in.h> -#include <afs/venus.h> -#if __STDC__ -/* On SunOS 4, afs/vice.h defines this to rely on a pre-ANSI cpp. */ -#undef _VICEIOCTL -#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl)) -#endif -#ifndef _IOW -/* AFS on Solaris 2.3 doesn't get this definition. */ -#include <sys/ioccom.h> -#endif - -static int -in_afs (path) - char *path; -{ - static char space[2048]; - struct ViceIoctl vi; - - vi.in_size = 0; - vi.out_size = sizeof (space); - vi.out = space; - - if (pioctl (path, VIOC_FILE_CELL_NAME, &vi, 1) - && (errno == EINVAL || errno == ENOENT)) - return 0; - return 1; -} -#endif /* AFS */ - -#include <glib.h> -#include <glib/gstdio.h> - -/* Nonzero if the current filesystem's type is known. */ -static int fstype_known = 0; - -char *filesystem_type (char *path, char *relpath, struct stat *statp); -/* Return a static string naming the type of filesystem that the file PATH, - described by STATP, is on. - RELPATH is the file name relative to the current directory. - Return "unknown" if its filesystem type is unknown. */ - -char * -filesystem_type (char *path, char *relpath, struct stat *statp) -{ - static char *current_fstype = NULL; - static dev_t current_dev; - - if (current_fstype != NULL) - { - if (fstype_known && statp->st_dev == current_dev) - return current_fstype; /* Cached value. */ - g_free (current_fstype); - } - current_dev = statp->st_dev; - current_fstype = filesystem_type_uncached (path, relpath, statp); - return current_fstype; -} - -void -fstype_internal_error (int level, int num, char const *fmt, ...) -{ -} - -/* Return a newly allocated string naming the type of filesystem that the - file PATH, described by STATP, is on. - RELPATH is the file name relative to the current directory. - Return "unknown" if its filesystem type is unknown. */ - -static char * -filesystem_type_uncached (char *path, char *relpath, struct stat *statp) -{ - char *type = NULL; - -#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ - char *table = MOUNTED; - FILE *mfp; - struct mntent *mnt; - - mfp = setmntent (table, "r"); - if (mfp == NULL) { - fstype_internal_error (1, errno, "%s", table); - goto no_mtab; - } - - /* Find the entry with the same device number as STATP, and return - that entry's fstype. */ - while (type == NULL && (mnt = getmntent (mfp))) - { - char *devopt; - dev_t dev; - struct stat disk_stats; - -#ifdef MNTTYPE_IGNORE - if (!strcmp (mnt->mnt_type, MNTTYPE_IGNORE)) - continue; -#endif - - /* Newer systems like SunOS 4.1 keep the dev number in the mtab, - in the options string. For older systems, we need to stat the - directory that the filesystem is mounted on to get it. - - Unfortunately, the HPUX 9.x mnttab entries created by automountq - contain a dev= option but the option value does not match the - st_dev value of the file (maybe the lower 16 bits match?). */ - -#if !defined(hpux) && !defined(__hpux__) - devopt = strstr (mnt->mnt_opts, "dev="); - if (devopt) - { - if (devopt[4] == '0' && (devopt[5] == 'x' || devopt[5] == 'X')) - dev = xatoi (devopt + 6); - else - dev = xatoi (devopt + 4); - } - else -#endif /* not hpux */ - { - if (g_stat (mnt->mnt_dir, &disk_stats) == -1) { - if (errno == EACCES) - continue; - else - fstype_internal_error (1, errno, "error in %s: %s", table, mnt->mnt_dir); - } - dev = disk_stats.st_dev; - } - - if (dev == statp->st_dev) - type = mnt->mnt_type; - } - - if (endmntent (mfp) == 0) - fstype_internal_error (0, errno, "%s", table); - no_mtab: -#endif - -#ifdef FSTYPE_GETMNT /* Ultrix. */ - int offset = 0; - struct fs_data fsd; - - while (type == NULL - && getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY, 0) > 0) - { - if (fsd.fd_req.dev == statp->st_dev) - type = gt_names[fsd.fd_req.fstype]; - } -#endif - -#ifdef FSTYPE_USG_STATFS /* SVR3. */ - struct statfs fss; - char typebuf[FSTYPSZ]; - - if (statfs (relpath, &fss, sizeof (struct statfs), 0) == -1) - { - /* Don't die if a file was just removed. */ - if (errno != ENOENT) - fstype_internal_error (1, errno, "%s", path); - } - else if (!sysfs (GETFSTYP, fss.f_fstyp, typebuf)) - type = typebuf; -#endif - -#ifdef FSTYPE_STATVFS /* SVR4. */ - struct statvfs fss; - - if (statvfs (relpath, &fss) == -1) - { - /* Don't die if a file was just removed. */ - if (errno != ENOENT) - fstype_internal_error (1, errno, "%s", path); - } - else - type = fss.f_basetype; -#endif - -#ifdef FSTYPE_STATFS /* 4.4BSD. */ - struct statfs fss; - char *p; - - if (S_ISLNK (statp->st_mode)) - p = dirname (relpath); - else - p = relpath; - - if (statfs (p, &fss) == -1) - { - /* Don't die if symlink to nonexisting file, or a file that was - just removed. */ - if (errno != ENOENT) - fstype_internal_error (1, errno, "%s", path); - } - else - { -#ifdef MFSNAMELEN /* NetBSD. */ - type = fss.f_fstypename; -#else - type = fstype_to_string (fss.f_type); -#endif - } - if (p != relpath) - free (p); -#endif - -#ifdef AFS - if ((!type || !strcmp (type, "xx")) && in_afs (relpath)) - type = "afs"; -#endif - - /* An unknown value can be caused by an ENOENT error condition. - Don't cache those values. */ - fstype_known = (type != NULL); - - return g_strdup (type ? type : "unknown"); -} - -#ifdef FSTYPE_MNTENT /* 4.3BSD etc. */ -/* Return the value of the hexadecimal number represented by CP. - No prefix (like '0x') or suffix (like 'h') is expected to be - part of CP. */ - -static int -xatoi (char *cp) -{ - int val; - - val = 0; - while (*cp) - { - if (*cp >= 'a' && *cp <= 'f') - val = val * 16 + *cp - 'a' + 10; - else if (*cp >= 'A' && *cp <= 'F') - val = val * 16 + *cp - 'A' + 10; - else if (*cp >= '0' && *cp <= '9') - val = val * 16 + *cp - '0'; - else - break; - cp++; - } - return val; -} -#endif diff --git a/po/ChangeLog b/po/ChangeLog index 2eb58db4..84e6288f 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,26 +1,23 @@ -2007-10-04 William Jon McCann <mccann@jhu.edu> +2007-10-15 William Jon McCann <mccann@jhu.edu> + + * POTFILES.in: + Remove unused file. - reviewed by: <delete if not using a buddy> +2007-10-04 William Jon McCann <mccann@jhu.edu> * POTFILES.in: * POTFILES.skip: 2007-10-04 William Jon McCann <mccann@jhu.edu> - reviewed by: <delete if not using a buddy> - * POTFILES.in: 2007-10-04 William Jon McCann <mccann@jhu.edu> - reviewed by: <delete if not using a buddy> - * POTFILES.in: 2007-10-04 William Jon McCann <mccann@jhu.edu> - reviewed by: <delete if not using a buddy> - * POTFILES.in: 2007-10-03 William Jon McCann <mccann@jhu.edu> diff --git a/po/POTFILES.in b/po/POTFILES.in index 6609ad6a..813d377a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -15,7 +15,6 @@ common/test-settings-client.c common/test-settings-server.c daemon/auth.c daemon/factory-slave-main.c -daemon/fstype.c daemon/gdm-display.c daemon/gdm-display-store.c daemon/gdm-factory-slave.c |