diff options
Diffstat (limited to 'src/filemode.c')
| -rw-r--r-- | src/filemode.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/filemode.c b/src/filemode.c index 4a11d2a3115..c3a5a924a93 100644 --- a/src/filemode.c +++ b/src/filemode.c | |||
| @@ -90,10 +90,10 @@ | |||
| 90 | #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) | 90 | #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
| 93 | void mode_string (); | 93 | void mode_string (short unsigned int mode, char *str); |
| 94 | static char ftypelet (); | 94 | static char ftypelet (long int bits); |
| 95 | static void rwx (); | 95 | static void rwx (short unsigned int bits, char *chars); |
| 96 | static void setst (); | 96 | static void setst (short unsigned int bits, char *chars); |
| 97 | 97 | ||
| 98 | /* filemodestring - fill in string STR with an ls-style ASCII | 98 | /* filemodestring - fill in string STR with an ls-style ASCII |
| 99 | representation of the st_mode field of file stats block STATP. | 99 | representation of the st_mode field of file stats block STATP. |
| @@ -132,9 +132,7 @@ static void setst (); | |||
| 132 | 'T' if the file is sticky but not executable. */ | 132 | 'T' if the file is sticky but not executable. */ |
| 133 | 133 | ||
| 134 | void | 134 | void |
| 135 | filemodestring (statp, str) | 135 | filemodestring (struct stat *statp, char *str) |
| 136 | struct stat *statp; | ||
| 137 | char *str; | ||
| 138 | { | 136 | { |
| 139 | mode_string (statp->st_mode, str); | 137 | mode_string (statp->st_mode, str); |
| 140 | } | 138 | } |
| @@ -143,9 +141,7 @@ filemodestring (statp, str) | |||
| 143 | is given as an argument. */ | 141 | is given as an argument. */ |
| 144 | 142 | ||
| 145 | void | 143 | void |
| 146 | mode_string (mode, str) | 144 | mode_string (short unsigned int mode, char *str) |
| 147 | unsigned short mode; | ||
| 148 | char *str; | ||
| 149 | { | 145 | { |
| 150 | str[0] = ftypelet ((long) mode); | 146 | str[0] = ftypelet ((long) mode); |
| 151 | rwx ((mode & 0700) << 0, &str[1]); | 147 | rwx ((mode & 0700) << 0, &str[1]); |
| @@ -167,8 +163,7 @@ mode_string (mode, str) | |||
| 167 | '?' for any other file type. */ | 163 | '?' for any other file type. */ |
| 168 | 164 | ||
| 169 | static char | 165 | static char |
| 170 | ftypelet (bits) | 166 | ftypelet (long int bits) |
| 171 | long bits; | ||
| 172 | { | 167 | { |
| 173 | #ifdef S_ISBLK | 168 | #ifdef S_ISBLK |
| 174 | if (S_ISBLK (bits)) | 169 | if (S_ISBLK (bits)) |
| @@ -207,9 +202,7 @@ ftypelet (bits) | |||
| 207 | flags in CHARS accordingly. */ | 202 | flags in CHARS accordingly. */ |
| 208 | 203 | ||
| 209 | static void | 204 | static void |
| 210 | rwx (bits, chars) | 205 | rwx (short unsigned int bits, char *chars) |
| 211 | unsigned short bits; | ||
| 212 | char *chars; | ||
| 213 | { | 206 | { |
| 214 | chars[0] = (bits & S_IRUSR) ? 'r' : '-'; | 207 | chars[0] = (bits & S_IRUSR) ? 'r' : '-'; |
| 215 | chars[1] = (bits & S_IWUSR) ? 'w' : '-'; | 208 | chars[1] = (bits & S_IWUSR) ? 'w' : '-'; |
| @@ -220,9 +213,7 @@ rwx (bits, chars) | |||
| 220 | according to the file mode BITS. */ | 213 | according to the file mode BITS. */ |
| 221 | 214 | ||
| 222 | static void | 215 | static void |
| 223 | setst (bits, chars) | 216 | setst (short unsigned int bits, char *chars) |
| 224 | unsigned short bits; | ||
| 225 | char *chars; | ||
| 226 | { | 217 | { |
| 227 | #ifdef S_ISUID | 218 | #ifdef S_ISUID |
| 228 | if (bits & S_ISUID) | 219 | if (bits & S_ISUID) |