lib/mountlist.c


Log

Author Commit Date CI Message
Paul Eggert 7c3f8da8 2005-09-23T04:15:13 Sync from coreutils. * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h, stat-time.h. * argmatch.h: Include verify.h (ARGMATCH_VERIFY): Use verify rather than rolling our own. (ARGMATCH_ASSERT): Remove; unused. * canonicalize.c: Assume STDC_HEADERS. * exclude.c: Include "strcase.h". * regex_internal.h [!defined _LIBC]: Likewise. * getusershell.c: Include stdio--.h rather than stdio.h and stdio-safer.h. (getusershell): Call fopen, not fopen_safer. * save-cwd.c: Include fcntl--.h rather than fcntl.h. Do not include unistd-safer.h. (save_cwd): Don't call fd_safer; no longer needed now that we include fcntl--.h. * modules/argmatch (Depends-on): Add verify. * modules/getloadavg (Depends-on): Depend on fcntl-safer, not unistd-safer. * modules/save-cwd (Depends-on): Likewise. * backupfile.m4, calloc.m4, chown.m4, cloexec.m4, dup2.m4: * fileblocks.m4, free.m4, ftruncate.m4, getcwd.m4, getpagesize.m4: * getugroups.m4, group-member.m4, idcache.m4, link-follow.m4: * mkstemp.m4, mktime.m4, mountlist.m4, nanosleep.m4, pathmax.m4: * physmem.m4, posixver.m4, putenv.m4, safe-read.m4, same.m4: * save-cwd.m4, stdio-safer.m4, unistd-safer.m4, unlinkdir.m4: * userspec.m4, xgetcwd.m4, xreadlink.m4: Don't bother checking for string.h, stdlib.h, unistd.h. * fts.m4 (gl_FUNC_FTS_CORE): Don't require AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK; that's now the lstat module's job. * jm-macros.m4 (gl_MACROS): Likewise. * prereq.m4 (gl_PREREQ): Add gl_FUNC_LSTAT. * backupfile.c: Use ARGMATCH_VERIFY, just in case. * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just the .tm_year member, since otherwise gcc-4.0 would now warn about tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday. * quotearg.c (quotearg_n_options): Change code to be suboptimal, in order to avoid an unsuppressible warning from gcc on 64-bit systems. * lstat.m4 (gl_FUNC_LSTAT): Use AC_LIBSOURCES to require lstat.c and lstat.h. Remove obsolete comment. * xreadlink.m4: Use AC_LIBSOURCES and AC_LIBOBJ. * xstrtod.m4: Likewise.
Paul Eggert 222b0486 2005-09-19T17:28:14 Use a consistent style for including <config.h>. * __fpending.c, acl.c, argmatch.c, argp-help.c, argp-parse.c, argp-pvh.c, backupfile.c, basename.c, c-stack.c, calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c, creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c, dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c, fd-safer.c, file-type.c, fileblocks.c, filemode.c, filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c, fsusage.c, ftruncate.c, full-write.c, fwriteerror.c, getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c, getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c, inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c, memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c, modechange.c, mountlist.c, open-safer.c, physmem.c, pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c, progreloc.c, putenv.c, quote.c, quotearg.c, readline.c, readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c, strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c, strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c, strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c, userspec.c, utimecmp.c, version-etc-fsf.c, version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c, xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c, xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c: Standardize inclusion of config.h. * __fpending.h, dirfd.h, getdate.h, human.h, inttostr.h: Removed inclusion of config.h from header files. * inttostr.c: Adjusted in-tree users. * timespec.h: Remove superfluous warning to include config.h. * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c, gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c, nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c, unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
Jim Meyering d1eb42bd 2005-07-02T09:45:07 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally, and don't include <sys/file.h>).
Paul Eggert 359c0a71 2005-06-02T20:41:04 Sync from coreutils. Use "file name" when talking about file names, instead of "filename" or "path", as per the GNU coding standards. * MODULES.html.sh: mkdir-p renamed from makepath. filenamecat renamed from path-concat. * modules/filenamecat: Renamed from modules/path-concat. (Files): filenamecat.h and filenamecat.c renamed from path-concat.h and path-concat.c. (configure.ac): gl_FILE_NAME_CONCAT, not gl_PATH_CONCAT. (Include): filenamecat.h, not path-concat.h. * modules/mkdir-p: Renamed from modules/makepath. (Files): mkdir-p.h and mkdir-p.c renamed from makepath.h and makepath.c. (configure.ac): gl_MKDIR_PARENTS, not gl_MAKEPATH. (Include): mkdir-p.h, not makepath.h. * lib/mkdir-p.c: Renamed from makepath.c. (make_dir_parents): Renamed from make_path. All callers changed. * lib/mkdir-p.h: Likewise. All includers changed. * lib/filenamecat.c: Renamed from path-concat.c. (file_name_concat): Renamed from path_concat. All callers changed. [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT. * lib/filenamecat.h: Likewise. All includers changed. * lib/acl.c: Don't use "path" or "filename" to mean "file name" in comments or local variable names. * lib/basename.c: Likewise. * lib/canonicalize.c, canonicalize.h: Likewise. * lib/dirname.c, dirname.h: Likewise. * lib/euidaccess.c: Likewise. * lib/exclude.c: Likewise * lib/fnmatch_.h, fnmatch_loop.c: Likewise. * lib/fsusage.c, fsuage.h: Likewise. * lib/fts.c, fts_.h: Likewise. * lib/getcwd.c: Likewise. * lib/getloadavg.c: Likewise. * lib/mkstemp.c: Likewise. * lib/mountlist.c, mountlist.h: Likewise. * lib/openat.c, openat.h: Likewise. * lib/readlink-stub.c: Likewise. * lib/readutmp.c, readutmp.h: Likewise. * lib/rename.c: Likewise. * lib/rmdir.c: Likewise. * lib/same.c: Likewise. * lib/savedir.c: Likewise. * lib/stripslash.c: Likewise. * lib/tempname.c: Likewise. * lib/xreadlink.c: Likewise. * lib/exclude.c (excluded_file_name): Renamed from excluded_filename. All uses changed. * lib/exclude.h: Likewise. * m4/mkdir-p.m4: Renamed from makepath.m4. (gl_MKDIR_PARENTS): Renamed from gl_MAKEPATH. All uses changed. Rename files from makepath.c to mkdir-p.c, and from makepath.h to mkdir-p.h. * m4/filenamecat.m4: Renamed from path-concat.m4. (gl_FILE_NAME_CONCAT): Renamed from gl_PATH_CONCAT. All uses changed. Rename files from path-concat.c to filenamecat.c, and from path-concat.h to filenamecat.h. * m4/getcwd-path-max.m4: Don't use "path" or "filename" to mean "file name" in local variables or comments. * rename.m4: Likewise. * lib/euidaccess.c (getuid, getgid, getuid, getegid) [!defined _POSIX_VERSION]: Remove decls; not needed these days. * lib/idcache.c (getpwuid, getpwnam, getgrgid, getgrnam) [!defined _POSIX_VERSION]: Remove decls; not needed these days. * lib/pathmax.h: Include <limits.h> unconditionally, since other files have been getting away with it for years (MORE/BSD 4.3 is extinct now). * lib/userspec.c (getpwnam, getgrnam, getgrgid) [!defined _POSIX_VERSION]: Remove decls; not needed these days. * lib/pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]: Define to 256, not 255, as per modern POSIX.
Paul Eggert 267a39ba 2005-05-14T06:03:57 *** empty log message ***
Paul Eggert 68650590 2005-02-01T23:56:46 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double inclusion. Include <sys/types.h>, for dev_t. (ME_DUMMY, ME_REMOTE): Move from here.... * mountlist.c (ME_DUMMY, ME_REMOTE): To here. (ME_DUMMY): Count "subfs" as a dummy. Problem reported by Dmitry V. Levin. Include mountlist.h first, to test the interface.
Paul Eggert 917752ad 2004-10-04T20:17:39 Remove dependencies on unlocked-io.
Paul Eggert a62be9f4 2004-08-07T00:09:38 Merge from coreutils.
Paul Eggert 6e9405a0 2004-03-31T07:30:08 Merge from coreutils.
Paul Eggert d0ac4f23 2003-11-01T06:00:45 Catch size calculation overflow problem on Alphas running OSF/1. Fix malloc FIXME in mountlist.c.
Bruno Haible 5dc4737c 2003-09-17T12:46:33 Comment about the validity of errno.
Paul Eggert 8b2c2981 2003-09-09T22:41:13 Remove K&R cruft.
Paul Eggert 49730380 2003-08-14T23:34:39 Merge mountlist changes from coreutils.
Jim Meyering 85f69266 2003-04-05T06:46:00 Merge change from Coreutils. (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any error from mntctl. Use mntctl's return value to drive the entry-processing loop, since we can't rely on the value of the vmt_length member in the last entry. On some systems doing so could result in exhausting virtual memory. Based in part on a patch from Mike Jetzer.
Jim Meyering 0d312a13 2002-11-21T09:51:39 update copyright date
Jim Meyering 46b1d153 2002-11-21T09:50:43 2002-07-13 Bruno Haible <bruno@clisp.org> #undef MNT_IGNORE before defining it, to avoid warning on FreeBSD.
Jim Meyering 47cf0718 2001-11-17T13:50:40 Include unlocked-io.h after all system headers. Remove explicit declarations of xmalloc, xrealloc, and xstrdup. Instead, include "xalloc.h".
Jim Meyering 92f1833a 2001-11-17T13:29:42 Include unlocked-io.h.
Jim Meyering dbe1ecde 2001-09-30T21:28:15 [MOUNTED_GETFSSTAT]: Include <sys/ucred.h>, for Apple Darwin. Include sys/mount.h and sys/fs_types.h only if available. (FS_TYPE): Define. (read_filesystem_list): Use FS_TYPE.
Jim Meyering 55b81b99 2001-09-23T08:56:11 Remove useless parentheses in #if directives. (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when the deprecated MOUNTED symbol is no longer defined in mntent.h.
Jim Meyering 9576a0ca 2000-07-01T13:35:28 Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV, per change in ../m4/ls-mntd-fs.m4. (read_filesystem_list): Ignore symbolic links.
Jim Meyering ed3c5c90 2000-06-29T08:30:03 (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]: Avoid warning by casting result to `char *' to remove `const'.
Jim Meyering bd85a91a 2000-06-03T22:09:03 move vmp decl back out to the scope where it belongs
Jim Meyering bcf3308e 2000-06-02T11:20:47 Back out last change. Instead, do this... (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy member using the same `ignore'-testing code.
Jim Meyering 3004e2c7 2000-05-29T16:23:45 (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts with the `ignore' attribute. Based on a patch from Mark D. Roth.
Jim Meyering f4802219 2000-05-01T08:03:33 (read_filesystem_list): Add BeOS support.
Jim Meyering c6a5094f 1999-07-26T06:52:28 *** empty log message ***
Jim Meyering 12c637b4 1999-07-20T18:52:05 update comments
Jim Meyering 34bd051e 1999-07-20T18:41:58 (translate_040_to_space) [MOUNTED_GETMNTENT1]: New function. (read_filesystem_list) [MOUNTED_GETMNTENT1]: Use it.
Jim Meyering 5542a382 1998-08-15T03:01:13 (read_filesystem_list) [MOUNTED_GETMNT]: Don't infloop on getmnt(2) returning 0. Christian von Roques
Jim Meyering ea12546c 1998-07-29T03:58:02 (read_filesystem_list): Remove all_fs argument, but put the necessary information into the result so that the caller can ignore filesystems that he's not interested in. From Paul.
Jim Meyering 83d2e1ba 1998-07-25T15:00:37 (xatoi): Ansideclify. (fstype_to_string): Ansideclify.
Jim Meyering a7e84e3d 1998-07-25T14:54:42 (read_filesystem_list) [MOUNTED_GETMNTINFO]: Use fsp_to_string. (fsp_to_string): Don't xmalloc return value (yet).
Jim Meyering feeb972f 1998-07-25T14:41:04 (read_filesystem_list): If all_fs is negative, omit non-local filesytems. From Paul Eggert.
Jim Meyering 0e334dd9 1998-07-18T12:28:31 (read_filesystem_list): Fix more memory leaks on failure. From Andreas Schwab.
Jim Meyering 2bc1fe2a 1998-07-04T00:48:11 (read_filesystem_list): Don't leak memory on failure. Don't create a dummy struct mount_entry entry; use the address-of-the-tail-address method instead. Preserve errno if possible on failure, setting it to 0 if inapplicable. Close file descriptor leak if the F_SETLKW failed. Report an error if SVR4 lock file cannot be opened for some reason other than a nonexistent lock file.
Jim Meyering 32a530aa 1998-06-30T14:32:53 (read_filesystem_list): Plug file descriptor leak on failure. Report failure if lock file can't be opened for some reason other than nonexistence.
Jim Meyering ff8b01f4 1998-06-30T03:56:57 (read_filesystem_list) [MOUNTED_GETMNTENT2]: Always close stream and file descriptor before returning.
Jim Meyering 07ce9324 1998-06-30T02:15:43 (read_filesystem_list): If SVR4, lock /etc/.mnttab.lock if available, to avoid race conditions (e.g. with the automounter on Solaris 2.6). Include <errno.h>, <fcntl.h>, <unistd.h>.
Jim Meyering b6a91103 1998-06-29T17:01:48 (fstype_to_string): Guard with #if ! HAVE_F_FSTYPENAME_IN_STATFS.
Jim Meyering c52618d1 1998-06-29T01:10:24 (fsp_to_string): Clean out some crufty #ifdefs now that we're using the jm_FSTYPENAME autoconf macro.
Jim Meyering 67f394c1 1998-03-15T11:09:10 Use #if, not #ifdef with HAVE_ macros
Jim Meyering 0f905c09 1997-12-25T17:02:25 Declare stpcpy only if not defined as macro.
Jim Meyering f542a4ad 1997-05-28T11:42:29 (read_filesystem_list): Add `|| defined (__OpenBSD__)' to the NetBSD #if so OpenBSD also uses the f_fstypename member. (fstype_to_string): Add `&& !defined (__OpenBSD__)' to the NetBSD #if expression to exclude this function definition. OpenBSD 2.1 beta doesn't need it. Patch from Hugh Daniel <hugh@ecotone.xanadu.com>
Jim Meyering 3b9c7bc2 1997-05-24T14:43:21 (read_filesystem_list): Show automount-related duplicate filesystems only when --all specified. With suggestions from Stuart Kemp.
Jim Meyering 57d62c35 1997-05-24T14:42:40 Indent cpp directives.
Jim Meyering 81d7fb95 1997-01-25T13:50:24 remove trailing blanks
Jim Meyering 040465a3 1996-10-12T23:21:32 (fstype_to_string): Handle fstypes of freebsd. From Arne Henrik Juul.
Jim Meyering 6d8337bf 1996-07-15T03:36:16 update FSF address in copyright
Jim Meyering 7f7c69fa 1996-05-23T13:04:41 (read_filesystem_list) [MOUNTED_LISTMNTENT]: New function. From Johan Danielsson (joda@pdc.kth.se).
Jim Meyering aa5959b9 1995-10-05T14:14:45 (read_filesystem_list): Cast -1 to dev_t before assignment.
Jim Meyering 36427d6c 1994-10-08T16:38:01 .
Jim Meyering d87c3946 1992-10-31T20:42:48 Initial revision