[Konsole-devel] KDE/kdebase/apps/konsole/src

Kurt Hindenburg kurt.hindenburg at gmail.com
Fri Aug 15 15:39:54 UTC 2008


SVN commit 847535 by hindenburg:

Use KDE_ instead of system calls; EBN Krazy fixes.

CCMAIL: konsole-devel at kde.org


 M  +6 -5      BlockArray.cpp  
 M  +3 -2      History.cpp  
 M  +3 -2      Pty.cpp  


--- trunk/KDE/kdebase/apps/konsole/src/BlockArray.cpp #847534:847535
@@ -29,6 +29,7 @@
 #include <stdio.h>
 
 // KDE
+#include <kde_file.h>
 #include <kdebug.h>
 
 using namespace Konsole;
@@ -65,7 +66,7 @@
     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 @@
 
 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 @@
     {
         // 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 @@
             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);
--- trunk/KDE/kdebase/apps/konsole/src/History.cpp #847534:847535
@@ -32,6 +32,7 @@
 #include <errno.h>
 
 // KDE
+#include <kde_file.h>
 #include <kdebug.h>
 
 // Reasonable line size
@@ -141,7 +142,7 @@
 
   int rc = 0;
 
-  rc = lseek(ion,length,SEEK_SET); if (rc < 0) { perror("HistoryFile::add.seek"); return; }
+  rc = KDE_lseek(ion,length,SEEK_SET); if (rc < 0) { perror("HistoryFile::add.seek"); return; }
   rc = write(ion,bytes,len);       if (rc < 0) { perror("HistoryFile::add.write"); return; }
   length += rc;
 }
@@ -167,7 +168,7 @@
 
   	if (loc < 0 || len < 0 || loc + len > length)
     	fprintf(stderr,"getHist(...,%d,%d): invalid args.\n",len,loc);
-  	rc = lseek(ion,loc,SEEK_SET); if (rc < 0) { perror("HistoryFile::get.seek"); return; }
+  	rc = KDE_lseek(ion,loc,SEEK_SET); if (rc < 0) { perror("HistoryFile::get.seek"); return; }
   	rc = read(ion,bytes,len);     if (rc < 0) { perror("HistoryFile::get.read"); return; }
   }
 }
--- trunk/KDE/kdebase/apps/konsole/src/Pty.cpp #847534:847535
@@ -38,6 +38,7 @@
 #include <KDebug>
 #include <KPty>
 #include <KPtyDevice>
+#include <kde_file.h>
 
 using namespace Konsole;
 
@@ -219,8 +220,8 @@
 
 void Pty::setWriteable(bool writeable)
 {
-  struct stat sbuf;
-  stat(pty()->ttyName(), &sbuf);
+  KDE_struct_stat sbuf;
+  KDE_stat(pty()->ttyName(), &sbuf);
   if (writeable)
     chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP);
   else



More information about the konsole-devel mailing list