mirror of
https://github.com/KDE/konsole.git
synced 2026-05-18 11:35:52 -04:00
Use KDE_ instead of system calls; EBN Krazy fixes.
CCMAIL: konsole-devel@kde.org svn path=/trunk/KDE/kdebase/apps/konsole/; revision=847535
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
// KDE
|
||||
#include <kde_file.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
using namespace Konsole;
|
||||
@@ -65,7 +66,7 @@ size_t BlockArray::append(Block *block)
|
||||
if (current >= size) current = 0;
|
||||
|
||||
int rc;
|
||||
rc = lseek(ion, current * blocksize, SEEK_SET); if (rc < 0) { perror("HistoryBuffer::add.seek"); setHistorySize(0); return size_t(-1); }
|
||||
rc = KDE_lseek(ion, current * blocksize, SEEK_SET); if (rc < 0) { perror("HistoryBuffer::add.seek"); setHistorySize(0); return size_t(-1); }
|
||||
rc = write(ion, block, blocksize); if (rc < 0) { perror("HistoryBuffer::add.write"); setHistorySize(0); return size_t(-1); }
|
||||
|
||||
length++;
|
||||
@@ -206,14 +207,14 @@ bool BlockArray::setHistorySize(size_t newsize)
|
||||
|
||||
void moveBlock(FILE *fion, int cursor, int newpos, char *buffer2)
|
||||
{
|
||||
int res = fseek(fion, cursor * blocksize, SEEK_SET);
|
||||
int res = KDE_fseek(fion, cursor * blocksize, SEEK_SET);
|
||||
if (res)
|
||||
perror("fseek");
|
||||
res = fread(buffer2, blocksize, 1, fion);
|
||||
if (res != 1)
|
||||
perror("fread");
|
||||
|
||||
res = fseek(fion, newpos * blocksize, SEEK_SET);
|
||||
res = KDE_fseek(fion, newpos * blocksize, SEEK_SET);
|
||||
if (res)
|
||||
perror("fseek");
|
||||
res = fwrite(buffer2, blocksize, 1, fion);
|
||||
@@ -302,7 +303,7 @@ void BlockArray::increaseBuffer()
|
||||
{
|
||||
// free one block in chain
|
||||
int firstblock = (offset + i) % size;
|
||||
res = fseek(fion, firstblock * blocksize, SEEK_SET);
|
||||
res = KDE_fseek(fion, firstblock * blocksize, SEEK_SET);
|
||||
if (res)
|
||||
perror("fseek");
|
||||
res = fread(buffer1, blocksize, 1, fion);
|
||||
@@ -315,7 +316,7 @@ void BlockArray::increaseBuffer()
|
||||
newpos = (cursor - offset + size) % size;
|
||||
moveBlock(fion, cursor, newpos, buffer2);
|
||||
}
|
||||
res = fseek(fion, i * blocksize, SEEK_SET);
|
||||
res = KDE_fseek(fion, i * blocksize, SEEK_SET);
|
||||
if (res)
|
||||
perror("fseek");
|
||||
res = fwrite(buffer1, blocksize, 1, fion);
|
||||
|
||||
Reference in New Issue
Block a user