From 80647f2201339726428889ffdea6e7602a5467a3 Mon Sep 17 00:00:00 2001 From: turbocat Date: Fri, 10 Sep 2021 18:50:14 +0000 Subject: [PATCH] libddk: fixed io functions git-svn-id: svn://kolibrios.org@9186 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ddk/io/create.c | 14 ++++++++------ drivers/ddk/io/finfo.c | 16 +++++++++------- drivers/ddk/io/ssize.c | 4 ++-- drivers/ddk/io/write.c | 8 +------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/ddk/io/create.c b/drivers/ddk/io/create.c index 69c73fde2c..23141de7a4 100644 --- a/drivers/ddk/io/create.c +++ b/drivers/ddk/io/create.c @@ -2,11 +2,13 @@ int create_file(const char *path) { - int err=0; - ksys70_t k; - k.p00 = 2; - k.p12 = 0; - k.p20 = 0; - k.p21 = path; + int err; + ksys70_t k; + k.p00 = 2; + k.p04dw = 0; + k.p08dw = 0; + k.p12 = 0; + k.p20 = 0; + k.p21 = path; return FS_Service(&k, &err); }; diff --git a/drivers/ddk/io/finfo.c b/drivers/ddk/io/finfo.c index 68dd2b4abf..5370af65d0 100644 --- a/drivers/ddk/io/finfo.c +++ b/drivers/ddk/io/finfo.c @@ -57,12 +57,14 @@ typedef struct int get_fileinfo(const char *path, FILEINFO *info) { - ksys70_t k; - int err; - k.p00 = 5; - k.bdfe = info; - k.p20 = 0; - k.p21 = path; + int err; + ksys70_t k; + k.p00 = 5; + k.p04dw = 0; + k.p08dw = 0; + k.p12 = 0; + k.bdfe = info; + k.p20 = 0; + k.p21 = path; return FS_Service(&k, &err); } - diff --git a/drivers/ddk/io/ssize.c b/drivers/ddk/io/ssize.c index ac95a8334b..8b2afe2d34 100644 --- a/drivers/ddk/io/ssize.c +++ b/drivers/ddk/io/ssize.c @@ -2,9 +2,9 @@ int set_file_size(const char *path, unsigned size) { - ksys70_t k; + ksys70_t k; int err; - k.p00 = 4; + k.p00 = 4; k.p04dw = size; k.p08dw = 0; k.p20 = 0; diff --git a/drivers/ddk/io/write.c b/drivers/ddk/io/write.c index 726acfc203..b486a9a118 100644 --- a/drivers/ddk/io/write.c +++ b/drivers/ddk/io/write.c @@ -10,11 +10,5 @@ int write_file(const char *path,const void *buff, k.cbuf16 = buff; k.p20 = 0; k.p21 = path; - int status; - unsigned bytes_written_v; - FS_Service(&k, &bytes_written_v); - if (!status){ - *writes = bytes_written_v; - } - return status; + return FS_Service(&k, writes); }