vfs: use LS_NOT_LINEAR constant.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-01-08 11:31:24 +03:00
parent cb354e5490
commit 95e1ab3064
4 changed files with 5 additions and 5 deletions

View File

@ -568,7 +568,7 @@ vfs_s_write (void *fh, const char *buffer, size_t count)
{
struct vfs_class *me = FH_SUPER->me;
if (FH->linear)
if (FH->linear != LS_NOT_LINEAR)
vfs_die ("no writing to linear files, please");
FH->changed = TRUE;
@ -1306,7 +1306,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
fh->ino = ino;
fh->handle = -1;
fh->changed = was_changed;
fh->linear = 0;
fh->linear = LS_NOT_LINEAR;
fh->data = NULL;
if (IS_LINEAR (flags))

View File

@ -1150,7 +1150,7 @@ fish_ctl (void *fh, int ctlop, void *arg)
{
int v;
if (FH->linear == 0)
if (FH->linear == LS_NOT_LINEAR)
vfs_die ("You may not do this");
if (FH->linear == LS_LINEAR_CLOSED || FH->linear == LS_LINEAR_PREOPEN)
return 0;

View File

@ -1996,7 +1996,7 @@ ftpfs_ctl (void *fh, int ctlop, void *arg)
{
int v;
if (!FH->linear)
if (FH->linear == LS_NOT_LINEAR)
vfs_die ("You may not do this");
if (FH->linear == LS_LINEAR_CLOSED || FH->linear == LS_LINEAR_PREOPEN)
return 0;

View File

@ -150,7 +150,7 @@ sftpfs_cb_open (const vfs_path_t * vpath, int flags, mode_t mode)
file_handler->ino = path_inode;
file_handler->handle = -1;
file_handler->changed = is_changed;
file_handler->linear = 0;
file_handler->linear = LS_NOT_LINEAR;
file_handler->data = NULL;
if (!sftpfs_open_file (file_handler, flags, mode, &mcerror))