From 70f30840d847ce3aad828d82e55ab4488841f4d9 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 3 Oct 1999 21:26:21 +0000 Subject: [PATCH] fall-back definitions for constans and casts for printfs git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7106 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftpd/ls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/appl/ftp/ftpd/ls.c b/appl/ftp/ftpd/ls.c index a62c3b586..a6a3dac98 100644 --- a/appl/ftp/ftpd/ls.c +++ b/appl/ftp/ftpd/ls.c @@ -62,6 +62,10 @@ struct fileinfo { #define LS_SIZE 32 #define LS_INODE 64 +#ifndef S_ISTXT +#define S_ISTXT S_ISVTX +#endif + static void make_fileinfo(const char *filename, struct fileinfo *file, int flags) { @@ -89,8 +93,10 @@ make_fileinfo(const char *filename, struct fileinfo *file, int flags) file->mode[0] = 'l'; else if(S_ISSOCK(st->st_mode)) file->mode[0] = 's'; +#ifdef S_ISWHT else if(S_ISWHT(st->st_mode)) file->mode[0] = 'w'; +#endif else file->mode[0] = '?'; { @@ -137,8 +143,8 @@ make_fileinfo(const char *filename, struct fileinfo *file, int flags) } if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) { - asprintf(&file->major, "%u", major(st->st_rdev)); - asprintf(&file->minor, "%u", minor(st->st_rdev)); + asprintf(&file->major, "%u", (unsigned)major(st->st_rdev)); + asprintf(&file->minor, "%u", (unsigned)minor(st->st_rdev)); } else asprintf(&file->size, "%lu", (unsigned long)st->st_size);