mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 13:10:57 -08:00
(Ffile_attributes) [WINDOWSNT]: Undo change from 2008-03-31, it's not needed
anymore with `struct stat' definition on nt/inc/sys/stat.h. Undo changes from 2007-01-12 and 2007-01-13 for the same reasons.
This commit is contained in:
parent
341dd15a7b
commit
01388a3dd2
2 changed files with 16 additions and 23 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2008-04-26 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* dired.c (Ffile_attributes) [WINDOWSNT]: Undo change from
|
||||
2008-03-31, it's not needed anymore with `struct stat' definition
|
||||
on nt/inc/sys/stat.h. Undo changes from 2007-01-12 and 2007-01-13
|
||||
for the same reasons.
|
||||
|
||||
2008-04-25 Chip Coldwell <coldwell@redhat.com>
|
||||
|
||||
* m/sparc.h: Additional redefinitions for GNU/Linux.
|
||||
|
|
|
|||
32
src/dired.c
32
src/dired.c
|
|
@ -942,7 +942,7 @@ Elements of the attribute list are:
|
|||
char modes[10];
|
||||
Lisp_Object handler;
|
||||
struct gcpro gcpro1;
|
||||
EMACS_INT uid, gid, ino;
|
||||
EMACS_INT ino;
|
||||
|
||||
filename = Fexpand_file_name (filename, Qnil);
|
||||
|
||||
|
|
@ -977,34 +977,20 @@ Elements of the attribute list are:
|
|||
#endif
|
||||
}
|
||||
values[1] = make_number (s.st_nlink);
|
||||
/* When make_fixnum_or_float is called below with types that are
|
||||
shorter than an int (e.g., `short'), GCC whines about comparison
|
||||
being always false due to limited range of data type. Fix by
|
||||
copying s.st_uid and s.st_gid into int variables. */
|
||||
#ifdef WINDOWSNT
|
||||
/* Windows uses signed short for the uid and gid in the stat structure,
|
||||
but we use an int for getuid (limited to the range 0-60000).
|
||||
So users with uid > 32767 need their uid patched back here. */
|
||||
uid = (unsigned short) s.st_uid;
|
||||
gid = (unsigned short) s.st_gid;
|
||||
#else
|
||||
uid = s.st_uid;
|
||||
gid = s.st_gid;
|
||||
#endif
|
||||
if (NILP (id_format) || EQ (id_format, Qinteger))
|
||||
{
|
||||
values[2] = make_fixnum_or_float (uid);
|
||||
values[3] = make_fixnum_or_float (gid);
|
||||
values[2] = make_fixnum_or_float (s.st_uid);
|
||||
values[3] = make_fixnum_or_float (s.st_gid);
|
||||
}
|
||||
else
|
||||
{
|
||||
BLOCK_INPUT;
|
||||
pw = (struct passwd *) getpwuid (uid);
|
||||
pw = (struct passwd *) getpwuid (s.st_uid);
|
||||
values[2] = (pw ? build_string (pw->pw_name)
|
||||
: make_fixnum_or_float (uid));
|
||||
gr = (struct group *) getgrgid (gid);
|
||||
: make_fixnum_or_float (s.st_uid));
|
||||
gr = (struct group *) getgrgid (s.st_gid);
|
||||
values[3] = (gr ? build_string (gr->gr_name)
|
||||
: make_fixnum_or_float (gid));
|
||||
: make_fixnum_or_float (s.st_gid));
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
values[4] = make_time (s.st_atime);
|
||||
|
|
@ -1026,11 +1012,11 @@ Elements of the attribute list are:
|
|||
if (! NILP (dirname))
|
||||
encoded = ENCODE_FILE (dirname);
|
||||
if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0)
|
||||
values[9] = (sdir.st_gid != gid) ? Qt : Qnil;
|
||||
values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil;
|
||||
else /* if we can't tell, assume worst */
|
||||
values[9] = Qt;
|
||||
#else /* file gid will be egid */
|
||||
values[9] = (gid != getegid ()) ? Qt : Qnil;
|
||||
values[9] = (s.st_gid != getegid ()) ? Qt : Qnil;
|
||||
#endif /* BSD4_2 (or BSD4_3) */
|
||||
/* Shut up GCC warnings in FIXNUM_OVERFLOW_P below. */
|
||||
if (sizeof (s.st_ino) > sizeof (ino))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue