projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb/gdbserver/
[binutils-gdb.git]
/
binutils
/
filemode.c
diff --git
a/binutils/filemode.c
b/binutils/filemode.c
index ca00694fb7820e84468f8121b5f381e851a9d00c..8b29defc5287a4af5087d2d8b6348e73c951acd5 100644
(file)
--- a/
binutils/filemode.c
+++ b/
binutils/filemode.c
@@
-1,10
+1,10
@@
/* filemode.c -- make a string describing file modes
/* filemode.c -- make a string describing file modes
- Copyright 1985, 1990, 1991, 1994, 1995, 1997
- Free Software Foundation, Inc.
+ Copyright 1985, 1990, 1991, 1994, 1995, 1997
, 1999, 2002, 2003, 2005,
+
2007
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
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)
+ the Free Software Foundation; either version
3
, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
any later version.
This program is distributed in the hope that it will be useful,
@@
-14,14
+14,15
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street - Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
\f
\f
+#include "sysdep.h"
#include "bfd.h"
#include "bucomm.h"
#include "bfd.h"
#include "bucomm.h"
-static char ftypelet
PARAMS ((unsigned long)
);
-static void setst
PARAMS ((unsigned long, char *)
);
+static char ftypelet
(unsigned long
);
+static void setst
(unsigned long, char *
);
/* filemodestring - fill in string STR with an ls-style ASCII
representation of the st_mode field of file stats block STATP.
/* filemodestring - fill in string STR with an ls-style ASCII
representation of the st_mode field of file stats block STATP.
@@
-59,20
+60,6
@@
static void setst PARAMS ((unsigned long, char *));
otherwise.
'T' if the file is sticky but not executable. */
otherwise.
'T' if the file is sticky but not executable. */
-#if 0
-
-/* This is not used; only mode_string is used. */
-
-void
-filemodestring (statp, str)
- struct stat *statp;
- char *str;
-{
- mode_string ((unsigned long) statp->st_mode, str);
-}
-
-#endif
-
/* Get definitions for the file permission bits. */
#ifndef S_IRWXU
/* Get definitions for the file permission bits. */
#ifndef S_IRWXU
@@
-118,9
+105,7
@@
filemodestring (statp, str)
is given as an argument. */
void
is given as an argument. */
void
-mode_string (mode, str)
- unsigned long mode;
- char *str;
+mode_string (unsigned long mode, char *str)
{
str[0] = ftypelet ((unsigned long) mode);
str[1] = (mode & S_IRUSR) != 0 ? 'r' : '-';
{
str[0] = ftypelet ((unsigned long) mode);
str[1] = (mode & S_IRUSR) != 0 ? 'r' : '-';
@@
-140,7
+125,7
@@
mode_string (mode, str)
'd' for directories
'b' for block special files
'c' for character special files
'd' for directories
'b' for block special files
'c' for character special files
- 'm' for multiplex
o
r files
+ 'm' for multiplex
e
r files
'l' for symbolic links
's' for sockets
'p' for fifos
'l' for symbolic links
's' for sockets
'p' for fifos
@@
-195,8
+180,7
@@
mode_string (mode, str)
#endif /* ! defined (S_ISLNK) */
static char
#endif /* ! defined (S_ISLNK) */
static char
-ftypelet (bits)
- unsigned long bits;
+ftypelet (unsigned long bits)
{
if (S_ISDIR (bits))
return 'd';
{
if (S_ISDIR (bits))
return 'd';
@@
-230,9
+214,7
@@
ftypelet (bits)
according to the file mode BITS. */
static void
according to the file mode BITS. */
static void
-setst (bits, chars)
- unsigned long bits ATTRIBUTE_UNUSED;
- char *chars ATTRIBUTE_UNUSED;
+setst (unsigned long bits ATTRIBUTE_UNUSED, char *chars ATTRIBUTE_UNUSED)
{
#ifdef S_ISUID
if (bits & S_ISUID)
{
#ifdef S_ISUID
if (bits & S_ISUID)