git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd52bcd
)
Misc code cleanup
author
John Hodge
<
[email protected]
>
Mon, 20 Aug 2012 11:36:28 +0000
(19:36 +0800)
committer
John Hodge
<
[email protected]
>
Mon, 20 Aug 2012 11:36:28 +0000
(19:36 +0800)
KernelLand/Kernel/drv/proc.c
patch
|
blob
|
history
KernelLand/Kernel/drvutil_disk.c
patch
|
blob
|
history
KernelLand/Kernel/include/api_drv_disk.h
patch
|
blob
|
history
KernelLand/Kernel/include/vfs_ext.h
patch
|
blob
|
history
KernelLand/Kernel/lib.c
patch
|
blob
|
history
KernelLand/Kernel/vfs/dir.c
patch
|
blob
|
history
KernelLand/Kernel/vfs/io.c
patch
|
blob
|
history
KernelLand/Kernel/vfs/main.c
patch
|
blob
|
history
KernelLand/Modules/Filesystems/FAT/common.h
patch
|
blob
|
history
KernelLand/Modules/Storage/LVM/mbr.c
patch
|
blob
|
history
Tools/DiskTool/src/actions.c
patch
|
blob
|
history
diff --git
a/KernelLand/Kernel/drv/proc.c
b/KernelLand/Kernel/drv/proc.c
index
b4483b0
..
e8cab19
100644
(file)
--- a/
KernelLand/Kernel/drv/proc.c
+++ b/
KernelLand/Kernel/drv/proc.c
@@
-250,8
+250,9
@@
int SysFS_UpdateFile(int ID, const char *Data, int Length)
for( ent = gSysFS_FileList; ent; ent = ent->Next )
{
// It's a reverse sorted list
for( ent = gSysFS_FileList; ent; ent = ent->Next )
{
// It's a reverse sorted list
- if(ent->Node.Inode < ID) return 0;
- if(ent->Node.Inode == ID)
+ if(ent->Node.Inode < (Uint64)ID)
+ return 0;
+ if(ent->Node.Inode == (Uint64)ID)
{
ent->Node.ImplPtr = (void*)Data;
ent->Node.Size = Length;
{
ent->Node.ImplPtr = (void*)Data;
ent->Node.Size = Length;
@@
-278,8
+279,8
@@
int SysFS_RemoveFile(int ID)
for( ent = gSysFS_FileList; ent; prev = ent, ent = ent->Next )
{
// It's a reverse sorted list
for( ent = gSysFS_FileList; ent; prev = ent, ent = ent->Next )
{
// It's a reverse sorted list
- if(ent->Node.Inode < ID) return 0;
- if(ent->Node.Inode == ID) break;
+ if(ent->Node.Inode <
(Uint64)
ID) return 0;
+ if(ent->Node.Inode ==
(Uint64)
ID) break;
}
if(!ent) return 0;
}
if(!ent) return 0;
@@
-326,7
+327,7
@@
int SysFS_RemoveFile(int ID)
char *SysFS_Comm_ReadDir(tVFS_Node *Node, int Pos)
{
tSysFS_Ent *child = (tSysFS_Ent*)Node->ImplPtr;
char *SysFS_Comm_ReadDir(tVFS_Node *Node, int Pos)
{
tSysFS_Ent *child = (tSysFS_Ent*)Node->ImplPtr;
- if(Pos < 0 || Pos >= Node->Size) return NULL;
+ if(Pos < 0 ||
(Uint64)
Pos >= Node->Size) return NULL;
for( ; child; child = child->Next, Pos-- )
{
for( ; child; child = child->Next, Pos-- )
{
diff --git
a/KernelLand/Kernel/drvutil_disk.c
b/KernelLand/Kernel/drvutil_disk.c
index
49dc7b2
..
a57917d
100644
(file)
--- a/
KernelLand/Kernel/drvutil_disk.c
+++ b/
KernelLand/Kernel/drvutil_disk.c
@@
-10,16
+10,16
@@
#include <api_drv_disk.h>
// --- Disk Driver Helpers ---
#include <api_drv_disk.h>
// --- Disk Driver Helpers ---
-
Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64
Length, void *Buffer,
- tDrvUtil_Read_Callback ReadBlocks,
Uint64
BlockSize, void *Argument)
+
size_t DrvUtil_ReadBlock(Uint64 Start, size_t
Length, void *Buffer,
+ tDrvUtil_Read_Callback ReadBlocks,
size_t
BlockSize, void *Argument)
{
Uint8 tmp[BlockSize]; // C99
Uint64 block = Start / BlockSize;
int offset = Start - block * BlockSize;
{
Uint8 tmp[BlockSize]; // C99
Uint64 block = Start / BlockSize;
int offset = Start - block * BlockSize;
-
int
leading = BlockSize - offset;
+
size_t
leading = BlockSize - offset;
Uint64 num;
int tailings;
Uint64 num;
int tailings;
-
Uint64
ret;
+
size_t
ret;
ENTER("XStart XLength pBuffer pReadBlocks XBlockSize pArgument",
Start, Length, Buffer, ReadBlocks, BlockSize, Argument);
ENTER("XStart XLength pBuffer pReadBlocks XBlockSize pArgument",
Start, Length, Buffer, ReadBlocks, BlockSize, Argument);
@@
-82,17
+82,17
@@
Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer,
return Length;
}
return Length;
}
-
Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64
Length, const void *Buffer,
+
size_t DrvUtil_WriteBlock(Uint64 Start, size_t
Length, const void *Buffer,
tDrvUtil_Read_Callback ReadBlocks, tDrvUtil_Write_Callback WriteBlocks,
tDrvUtil_Read_Callback ReadBlocks, tDrvUtil_Write_Callback WriteBlocks,
-
Uint64
BlockSize, void *Argument)
+
size_t
BlockSize, void *Argument)
{
Uint8 tmp[BlockSize]; // C99
Uint64 block = Start / BlockSize;
{
Uint8 tmp[BlockSize]; // C99
Uint64 block = Start / BlockSize;
-
int
offset = Start - block * BlockSize;
-
int
leading = BlockSize - offset;
+
size_t
offset = Start - block * BlockSize;
+
size_t
leading = BlockSize - offset;
Uint64 num;
int tailings;
Uint64 num;
int tailings;
-
Uint64
ret;
+
size_t
ret;
ENTER("XStart XLength pBuffer pReadBlocks pWriteBlocks XBlockSize pArgument",
Start, Length, Buffer, ReadBlocks, WriteBlocks, BlockSize, Argument);
ENTER("XStart XLength pBuffer pReadBlocks pWriteBlocks XBlockSize pArgument",
Start, Length, Buffer, ReadBlocks, WriteBlocks, BlockSize, Argument);
diff --git
a/KernelLand/Kernel/include/api_drv_disk.h
b/KernelLand/Kernel/include/api_drv_disk.h
index
c37dfec
..
bde78ab
100644
(file)
--- a/
KernelLand/Kernel/include/api_drv_disk.h
+++ b/
KernelLand/Kernel/include/api_drv_disk.h
@@
-161,8
+161,8
@@
typedef Uint (*tDrvUtil_Write_Callback)(Uint64 Address, Uint Count, const void *
* \param Argument An argument to pass to \a ReadBlocks
\r
* \return Number of bytes read
\r
*/
\r
* \param Argument An argument to pass to \a ReadBlocks
\r
* \return Number of bytes read
\r
*/
\r
-extern
Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64
Length, void *Buffer,
\r
- tDrvUtil_Read_Callback ReadBlocks,
Uint64
BlockSize, void *Argument);
\r
+extern
size_t DrvUtil_ReadBlock(Uint64 Start, size_t
Length, void *Buffer,
\r
+ tDrvUtil_Read_Callback ReadBlocks,
size_t
BlockSize, void *Argument);
\r
/**
\r
* \brief Writes a range to a block device using aligned writes
\r
* \param Start Base byte offset
\r
/**
\r
* \brief Writes a range to a block device using aligned writes
\r
* \param Start Base byte offset
\r
@@
-174,9
+174,9
@@
extern Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer,
* \param Argument An argument to pass to \a ReadBlocks and \a WriteBlocks
\r
* \return Number of bytes written
\r
*/
\r
* \param Argument An argument to pass to \a ReadBlocks and \a WriteBlocks
\r
* \return Number of bytes written
\r
*/
\r
-extern
Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64
Length, const void *Buffer,
\r
+extern
size_t DrvUtil_WriteBlock(Uint64 Start, size_t
Length, const void *Buffer,
\r
tDrvUtil_Read_Callback ReadBlocks, tDrvUtil_Write_Callback WriteBlocks,
\r
tDrvUtil_Read_Callback ReadBlocks, tDrvUtil_Write_Callback WriteBlocks,
\r
-
Uint64
BlockSize, void *Argument);
\r
+
size_t
BlockSize, void *Argument);
\r
\r
/**
\r
* \}
\r
\r
/**
\r
* \}
\r
diff --git
a/KernelLand/Kernel/include/vfs_ext.h
b/KernelLand/Kernel/include/vfs_ext.h
index
8cabfa1
..
d9bc833
100644
(file)
--- a/
KernelLand/Kernel/include/vfs_ext.h
+++ b/
KernelLand/Kernel/include/vfs_ext.h
@@
-276,7
+276,7
@@
extern Uint64 VFS_Tell(int FD);
* \param Buffer Destination of read data
* \return Number of read bytes
*/
* \param Buffer Destination of read data
* \return Number of read bytes
*/
-extern
Uint64 VFS_Read(int FD, Uint64
Length, void *Buffer);
+extern
size_t VFS_Read(int FD, size_t
Length, void *Buffer);
/**
* \brief Writes data to a file
* \param FD File handle returned by ::VFS_Open
/**
* \brief Writes data to a file
* \param FD File handle returned by ::VFS_Open
@@
-284,7
+284,7
@@
extern Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer);
* \param Buffer Source of written data
* \return Number of bytes written
*/
* \param Buffer Source of written data
* \return Number of bytes written
*/
-extern
Uint64 VFS_Write(int FD, Uint64
Length, const void *Buffer);
+extern
size_t VFS_Write(int FD, size_t
Length, const void *Buffer);
/**
* \brief Reads from a specific offset in the file
/**
* \brief Reads from a specific offset in the file
@@
-294,7
+294,7
@@
extern Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer);
* \param Buffer Source of read data
* \return Number of bytes read
*/
* \param Buffer Source of read data
* \return Number of bytes read
*/
-extern
Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64
Length, void *Buffer);
+extern
size_t VFS_ReadAt(int FD, Uint64 Offset, size_t
Length, void *Buffer);
/**
* \brief Writes to a specific offset in the file
* \param FD File handle returned by ::VFS_Open
/**
* \brief Writes to a specific offset in the file
* \param FD File handle returned by ::VFS_Open
@@
-303,7
+303,7
@@
extern Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer);
* \param Buffer Source of written data
* \return Number of bytes written
*/
* \param Buffer Source of written data
* \return Number of bytes written
*/
-extern
Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64
Length, const void *Buffer);
+extern
size_t VFS_WriteAt(int FD, Uint64 Offset, size_t
Length, const void *Buffer);
/**
* \brief Sends an IOCtl request to the driver
/**
* \brief Sends an IOCtl request to the driver
diff --git
a/KernelLand/Kernel/lib.c
b/KernelLand/Kernel/lib.c
index
68d2032
..
36b877c
100644
(file)
--- a/
KernelLand/Kernel/lib.c
+++ b/
KernelLand/Kernel/lib.c
@@
-124,7
+124,7
@@
int strpos8(const char *str, Uint32 Search)
{
// ASCII Range
if(Search < 128) {
{
// ASCII Range
if(Search < 128) {
- if(str[pos] ==
Search)
return pos;
+ if(str[pos] ==
(char)Search)
return pos;
continue;
}
if(*(Uint8*)(str+pos) < 128) continue;
continue;
}
if(*(Uint8*)(str+pos) < 128) continue;
@@
-387,7
+387,7
@@
int ModUtil_SetIdent(char *Dest, const char *Value)
int Hex(char *Dest, size_t Size, const Uint8 *SourceData)
{
int Hex(char *Dest, size_t Size, const Uint8 *SourceData)
{
-
int
i;
+
size_t
i;
for( i = 0; i < Size; i ++ )
{
sprintf(Dest + i*2, "%02x", SourceData[i]);
for( i = 0; i < Size; i ++ )
{
sprintf(Dest + i*2, "%02x", SourceData[i]);
@@
-400,8
+400,7
@@
int Hex(char *Dest, size_t Size, const Uint8 *SourceData)
*/
int UnHex(Uint8 *Dest, size_t DestSize, const char *SourceString)
{
*/
int UnHex(Uint8 *Dest, size_t DestSize, const char *SourceString)
{
- int i;
-
+ size_t i;
for( i = 0; i < DestSize*2; i += 2 )
{
Uint8 val = 0;
for( i = 0; i < DestSize*2; i += 2 )
{
Uint8 val = 0;
diff --git
a/KernelLand/Kernel/vfs/dir.c
b/KernelLand/Kernel/vfs/dir.c
index
26f6f0f
..
65218af
100644
(file)
--- a/
KernelLand/Kernel/vfs/dir.c
+++ b/
KernelLand/Kernel/vfs/dir.c
@@
-163,7
+163,7
@@
int VFS_ReadDir(int FD, char *Dest)
return 0;
}
return 0;
}
- if(h->Node->Size != -1 && h->Position >= h->Node->Size) {
+ if(h->Node->Size !=
(Uint64)
-1 && h->Position >= h->Node->Size) {
//LEAVE('i', 0);
return 0;
}
//LEAVE('i', 0);
return 0;
}
diff --git
a/KernelLand/Kernel/vfs/io.c
b/KernelLand/Kernel/vfs/io.c
index
7379e3d
..
dc55fe2
100644
(file)
--- a/
KernelLand/Kernel/vfs/io.c
+++ b/
KernelLand/Kernel/vfs/io.c
@@
-4,18
+4,19
@@
*/
#define DEBUG 0
#include <acess.h>
*/
#define DEBUG 0
#include <acess.h>
-#include "vfs.h"
-#include "vfs_int.h"
+#include <vfs.h>
+#include <vfs_ext.h>
+#include <vfs_int.h>
// === CODE ===
/**
* \fn Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer)
* \brief Read data from a node (file)
*/
// === CODE ===
/**
* \fn Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer)
* \brief Read data from a node (file)
*/
-
Uint64 VFS_Read(int FD, Uint64
Length, void *Buffer)
+
size_t VFS_Read(int FD, size_t
Length, void *Buffer)
{
tVFS_Handle *h;
{
tVFS_Handle *h;
-
Uint64
ret;
+
size_t
ret;
ENTER("iFD XLength pBuffer", FD, Length, Buffer);
ENTER("iFD XLength pBuffer", FD, Length, Buffer);
@@
-46,7
+47,7
@@
Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer)
}
ret = h->Node->Type->Read(h->Node, h->Position, Length, Buffer);
}
ret = h->Node->Type->Read(h->Node, h->Position, Length, Buffer);
- if(ret == -1) LEAVE_RET('i', -1);
+ if(ret ==
(size_t)
-1) LEAVE_RET('i', -1);
h->Position += ret;
LEAVE('X', ret);
h->Position += ret;
LEAVE('X', ret);
@@
-57,10
+58,10
@@
Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer)
* \fn Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer)
* \brief Read data from a given offset (atomic)
*/
* \fn Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer)
* \brief Read data from a given offset (atomic)
*/
-
Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64
Length, void *Buffer)
+
size_t VFS_ReadAt(int FD, Uint64 Offset, size_t
Length, void *Buffer)
{
tVFS_Handle *h;
{
tVFS_Handle *h;
-
Uint64
ret;
+
size_t
ret;
h = VFS_GetHandle(FD);
if(!h) return -1;
h = VFS_GetHandle(FD);
if(!h) return -1;
@@
-80,7
+81,7
@@
Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer)
}
ret = h->Node->Type->Read(h->Node, Offset, Length, Buffer);
}
ret = h->Node->Type->Read(h->Node, Offset, Length, Buffer);
- if(ret == -1) return -1;
+ if(ret ==
(size_t)
-1) return -1;
return ret;
}
return ret;
}
@@
-88,10
+89,10
@@
Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer)
* \fn Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer)
* \brief Read data from a node (file)
*/
* \fn Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer)
* \brief Read data from a node (file)
*/
-
Uint64 VFS_Write(int FD, Uint64
Length, const void *Buffer)
+
size_t VFS_Write(int FD, size_t
Length, const void *Buffer)
{
tVFS_Handle *h;
{
tVFS_Handle *h;
-
Uint64
ret;
+
size_t
ret;
h = VFS_GetHandle(FD);
if(!h) return -1;
h = VFS_GetHandle(FD);
if(!h) return -1;
@@
-108,7
+109,7
@@
Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer)
}
ret = h->Node->Type->Write(h->Node, h->Position, Length, Buffer);
}
ret = h->Node->Type->Write(h->Node, h->Position, Length, Buffer);
- if(ret == -1) return -1;
+ if(ret ==
(size_t)
-1) return -1;
h->Position += ret;
return ret;
h->Position += ret;
return ret;
@@
-118,10
+119,10
@@
Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer)
* \fn Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, const void *Buffer)
* \brief Write data to a file at a given offset
*/
* \fn Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, const void *Buffer)
* \brief Write data to a file at a given offset
*/
-
Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64
Length, const void *Buffer)
+
size_t VFS_WriteAt(int FD, Uint64 Offset, size_t
Length, const void *Buffer)
{
tVFS_Handle *h;
{
tVFS_Handle *h;
-
Uint64
ret;
+
size_t
ret;
h = VFS_GetHandle(FD);
if(!h) return -1;
h = VFS_GetHandle(FD);
if(!h) return -1;
@@
-137,7
+138,7
@@
Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, const void *Buffer)
return -1;
}
ret = h->Node->Type->Write(h->Node, Offset, Length, Buffer);
return -1;
}
ret = h->Node->Type->Write(h->Node, Offset, Length, Buffer);
- if(ret == -1) return -1;
+ if(ret ==
(size_t)
-1) return -1;
return ret;
}
return ret;
}
@@
-180,7
+181,7
@@
int VFS_Seek(int FD, Sint64 Offset, int Whence)
// Set relative to end of file
if(Whence < 0) {
// Set relative to end of file
if(Whence < 0) {
- if( h->Node->Size == -1 ) return -1;
+ if( h->Node->Size ==
(Uint64)
-1 ) return -1;
h->Position = h->Node->Size - Offset;
return 0;
h->Position = h->Node->Size - Offset;
return 0;
diff --git
a/KernelLand/Kernel/vfs/main.c
b/KernelLand/Kernel/vfs/main.c
index
5ff0e7c
..
38f7c80
100644
(file)
--- a/
KernelLand/Kernel/vfs/main.c
+++ b/
KernelLand/Kernel/vfs/main.c
@@
-27,7
+27,7
@@
void VFS_UpdateDriverFile(void);
EXPORT(VFS_AddDriver);
// === GLOBALS ===
EXPORT(VFS_AddDriver);
// === GLOBALS ===
-tVFS_Node NULLNode = {
0
};
+tVFS_Node NULLNode = {
.Type=NULL
};
tShortSpinlock slDriverListLock;
tVFS_Driver *gVFS_Drivers = NULL;
char *gsVFS_DriverFile = NULL;
tShortSpinlock slDriverListLock;
tVFS_Driver *gVFS_Drivers = NULL;
char *gsVFS_DriverFile = NULL;
diff --git
a/KernelLand/Modules/Filesystems/FAT/common.h
b/KernelLand/Modules/Filesystems/FAT/common.h
index
79513a9
..
b473bf7
100644
(file)
--- a/
KernelLand/Modules/Filesystems/FAT/common.h
+++ b/
KernelLand/Modules/Filesystems/FAT/common.h
@@
-46,7
+46,7
@@
struct sFAT_VolInfo
Uint32 ClusterCount; //!< Total Cluster Count
fat_bootsect bootsect; //!< Boot Sector
tVFS_Node rootNode; //!< Root Node
Uint32 ClusterCount; //!< Total Cluster Count
fat_bootsect bootsect; //!< Boot Sector
tVFS_Node rootNode; //!< Root Node
-
int
BytesPerCluster;
+
size_t
BytesPerCluster;
tMutex lNodeCache;
tFAT_CachedNode *NodeCache;
tMutex lNodeCache;
tFAT_CachedNode *NodeCache;
diff --git
a/KernelLand/Modules/Storage/LVM/mbr.c
b/KernelLand/Modules/Storage/LVM/mbr.c
index
c137a8a
..
67fdbce
100644
(file)
--- a/
KernelLand/Modules/Storage/LVM/mbr.c
+++ b/
KernelLand/Modules/Storage/LVM/mbr.c
@@
-76,7
+76,8
@@
int LVM_MBR_CountSubvolumes(tLVM_Vol *Volume, void *FirstSector)
while(extendedLBA != 0)
{
extendedLBA = LVM_MBR_int_ReadExt(Volume, extendedLBA, &base, &len);
while(extendedLBA != 0)
{
extendedLBA = LVM_MBR_int_ReadExt(Volume, extendedLBA, &base, &len);
- if( extendedLBA == -1 ) break;
+ if( extendedLBA == (Uint64)-1 )
+ break;
numPartitions ++;
}
LOG("numPartitions = %i", numPartitions);
numPartitions ++;
}
LOG("numPartitions = %i", numPartitions);
@@
-127,7
+128,8
@@
void LVM_MBR_PopulateSubvolumes(tLVM_Vol *Volume, void *FirstSector)
while(extendedLBA != 0)
{
extendedLBA = LVM_MBR_int_ReadExt(Volume, extendedLBA, &base, &len);
while(extendedLBA != 0)
{
extendedLBA = LVM_MBR_int_ReadExt(Volume, extendedLBA, &base, &len);
- if(extendedLBA == -1) break;
+ if(extendedLBA == (Uint64)-1)
+ break;
LVM_int_SetSubvolume_Anon( Volume, j, base, len );
j ++ ;
}
LVM_int_SetSubvolume_Anon( Volume, j, base, len );
j ++ ;
}
diff --git
a/Tools/DiskTool/src/actions.c
b/Tools/DiskTool/src/actions.c
index
665a595
..
074aab9
100644
(file)
--- a/
Tools/DiskTool/src/actions.c
+++ b/
Tools/DiskTool/src/actions.c
@@
-84,8
+84,6
@@
int DiskTool_MountImage(const char *Identifier, const char *Path)
// Translate path
size_t tpath_len = DiskTool_int_TranslatePath(NULL, Path);
// Translate path
size_t tpath_len = DiskTool_int_TranslatePath(NULL, Path);
- if(tpath_len == -1)
- return -1;
char tpath[tpath_len-1];
DiskTool_int_TranslatePath(tpath, Path);
char tpath[tpath_len-1];
DiskTool_int_TranslatePath(tpath, Path);
@@
-191,7
+189,7
@@
void DiskTool_LVM_Cleanup(void *Handle)
int DiskTool_int_TranslateOpen(const char *File, int Flags)
{
size_t tpath_len = DiskTool_int_TranslatePath(NULL, File);
int DiskTool_int_TranslateOpen(const char *File, int Flags)
{
size_t tpath_len = DiskTool_int_TranslatePath(NULL, File);
- if(tpath_len ==
-1
)
+ if(tpath_len ==
0
)
return -1;
char tpath[tpath_len-1];
DiskTool_int_TranslatePath(tpath, File);
return -1;
char tpath[tpath_len-1];
DiskTool_int_TranslatePath(tpath, File);
UCC
git Repository :: git.ucc.asn.au