From 1956fbfee9a1590c64da73950787a51bf48763b3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 2 Oct 2015 11:45:27 +0100 Subject: [PATCH] standalone: getmode() conflicts with BSD includes --- Standalone/fuzix_fs.h | 2 +- Standalone/xfs1.c | 18 +++++++++--------- Standalone/xfs1a.c | 4 ++-- Standalone/xfs1b.c | 10 +++++----- Standalone/xfs2.c | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Standalone/fuzix_fs.h b/Standalone/fuzix_fs.h index 9c44c81b..79f54ee9 100644 --- a/Standalone/fuzix_fs.h +++ b/Standalone/fuzix_fs.h @@ -312,7 +312,7 @@ int _ioctl( int fd, int request, char *data); int getperm(inoptr ino); int _mount( char *spec, char *dir, int rwflag); int _time( int tvec[]); -int getmode(inoptr ino); +int fuzix_getmode(inoptr ino); void bawrite(bufptr bp); int isdevice(inoptr ino); int bfree(bufptr bp, int dirty); diff --git a/Standalone/xfs1.c b/Standalone/xfs1.c index 3202b5a5..ca1dff64 100644 --- a/Standalone/xfs1.c +++ b/Standalone/xfs1.c @@ -55,7 +55,7 @@ int _open(char *name, int16_t flag) register inoptr ino; register int16_t perm; inoptr n_open(); - int getperm(), getmode(), isdevice(), d_open(); + int getperm(), fuzix_getmode(), isdevice(), d_open(); int uf_alloc(), oft_alloc(); udata.u_error = 0; @@ -82,7 +82,7 @@ int _open(char *name, int16_t flag) goto cantopen; } - if (getmode(ino) == F_DIR && + if (fuzix_getmode(ino) == F_DIR && (flag == FO_WRONLY || flag == FO_RDWR)) { udata.u_error = EISDIR; goto cantopen; @@ -145,7 +145,7 @@ int _creat(char *name, int16_t mode) register int16_t j; inoptr n_open(); inoptr newfile(); - int getperm(), getmode(), uf_alloc(), oft_alloc(); + int getperm(), fuzix_getmode(), uf_alloc(), oft_alloc(); udata.u_error = 0; parent = NULLINODE; @@ -158,7 +158,7 @@ int _creat(char *name, int16_t mode) ino = n_open(name, &parent); if (ino) { i_deref(parent); - if (getmode(ino) == F_DIR) { + if (fuzix_getmode(ino) == F_DIR) { i_deref(ino); udata.u_error = EISDIR; goto nogood; @@ -168,7 +168,7 @@ int _creat(char *name, int16_t mode) udata.u_error = EACCES; goto nogood; } - if (getmode(ino) == F_REG) { + if (fuzix_getmode(ino) == F_REG) { /* Truncate the file to zero length */ f_trunc(ino); /* Reset any oft pointers */ @@ -213,13 +213,13 @@ int _link(char *name1, char *name2) inoptr parent2; char *filename(); inoptr n_open(); - int ch_link(), getmode(), super(); + int ch_link(), fuzix_getmode(), super(); udata.u_error = 0; ifnot(ino = n_open(name1, NULLINOPTR)) return (-1); - if (getmode(ino) == F_DIR && !super()) { + if (fuzix_getmode(ino) == F_DIR && !super()) { udata.u_error = EPERM; goto nogood; } @@ -266,7 +266,7 @@ int _unlink(char *path) char *filename(); /*-- inoptr i_open();--*/ inoptr n_open(); - int getmode(), ch_link(), super(); + int fuzix_getmode(), ch_link(), super(); udata.u_error = 0; ino = n_open(path, &pino); @@ -276,7 +276,7 @@ int _unlink(char *path) return (-1); } - if (getmode(ino) == F_DIR && !super()) { + if (fuzix_getmode(ino) == F_DIR && !super()) { udata.u_error = EPERM; goto nogood; } diff --git a/Standalone/xfs1a.c b/Standalone/xfs1a.c index 9073f334..96c212ef 100644 --- a/Standalone/xfs1a.c +++ b/Standalone/xfs1a.c @@ -55,7 +55,7 @@ void readi(inoptr ino) int dev; dev = ino->c_dev; - switch (getmode(ino)) { + switch (fuzix_getmode(ino)) { case F_DIR: case F_REG: @@ -108,7 +108,7 @@ void writei(inoptr ino) dev = ino->c_dev; - switch (getmode(ino)) { + switch (fuzix_getmode(ino)) { case F_BDEV: dev = swizzle16(*(ino->c_node.i_addr)); diff --git a/Standalone/xfs1b.c b/Standalone/xfs1b.c index 1beebe2b..24d0c195 100644 --- a/Standalone/xfs1b.c +++ b/Standalone/xfs1b.c @@ -92,13 +92,13 @@ int _chdir(char *dir) { register inoptr newcwd; inoptr n_open(); - int getmode(); + int fuzix_getmode(); udata.u_error = 0; ifnot(newcwd = n_open(dir, NULLINOPTR)) return (-1); - if (getmode(newcwd) != F_DIR) { + if (fuzix_getmode(newcwd) != F_DIR) { udata.u_error = ENOTDIR; i_deref(newcwd); return (-1); @@ -362,11 +362,11 @@ int _mount(char *spec, char *dir, int rwflag) i_deref(sino); return (-1); } - if (getmode(sino) != F_BDEV) { + if (fuzix_getmode(sino) != F_BDEV) { udata.u_error = ENOTBLK; goto nogood; } - if (getmode(dino) != F_DIR) { + if (fuzix_getmode(dino) != F_DIR) { udata.u_error = ENOTDIR; goto nogood; } @@ -412,7 +412,7 @@ int _umount(char *spec) ifnot(sino = n_open(spec, NULLINOPTR)) return (-1); - if (getmode(sino) != F_BDEV) { + if (fuzix_getmode(sino) != F_BDEV) { udata.u_error = ENOTBLK; goto nogood; } diff --git a/Standalone/xfs2.c b/Standalone/xfs2.c index dac8b9b3..7a8f558e 100644 --- a/Standalone/xfs2.c +++ b/Standalone/xfs2.c @@ -56,7 +56,7 @@ inoptr n_open(register char *name, register inoptr * parent) } i_deref(wd); wd = ninode; - if (getmode(wd) != F_DIR) { + if (fuzix_getmode(wd) != F_DIR) { udata.u_error = ENOTDIR; goto nodir; } @@ -814,7 +814,7 @@ blkno_t bmap(inoptr ip, blkno_t bn, int rwflg) int sh; int dev; - if (getmode(ip) == F_BDEV) + if (fuzix_getmode(ip) == F_BDEV) return (bn); dev = ip->c_dev; @@ -976,7 +976,7 @@ void setftime(inoptr ino, int flag) } -int getmode(inoptr ino) +int fuzix_getmode(inoptr ino) { return (swizzle16(ino->c_node.i_mode) & F_MASK); } -- 2.34.1