Bug#406470: [Pkg-kde-extras] Bug#406470: patch for openafs FIFO problem

2007-03-22 Thread Mark Purcell
On Thursday 22 March 2007 20:57, Thomas Braun wrote:

 attached is an even better solution.
 The fifos are now created in /tmp and in /home/$user are only symlinks 
 created. So now also users on an filesytem without fifos (like openafs) 
 should be able to use the feature :)
 The patch has to be applied to the unpatched sources.

Thanks Thomas,

I have now included your patch and uploaded to Debian/unstable.

Btw, we have a number of outstanding bugs against kile at 
http://packages.debian.org/kile, which we could use some assistance with.

Also we do have a package tracking system at 
http://packages.qa.debian.org/k/kile.html, which you can subscribe to via 
email and receive our email bug reports as they happen.

Mark


pgpmBqRXPUycJ.pgp
Description: PGP signature


Bug#406470: patch for openafs FIFO problem

2007-03-04 Thread Thomas Braun
On Friday 02 March 2007 11:10, Alexander Klauer wrote:
 I've patched and rebuilt the package (kile_1.9.3-1_i386.deb); it works both
 for me and the user who reported the problem to me: when the option is
 checked, kile no longer consumes all CPU time and an error message is
 printed to the konsole from which kile is started. Thank you very much.

Hello Alexander,

I'm glad to hear that. :)

@DD-responsible-for-kile:
I've spoken with other kile devs and we propose to include this patch into 
debian version of kile. What do you think?

 Unfortunately I can't give you AFS access, only the people from our
 university computing centre can do that.

No problem, if you try the patch it is enough.

Regards,
Thomas


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#406470: patch for openafs FIFO problem

2007-03-02 Thread Alexander Klauer
Hello Thomas,


Thomas Braun:
 [...]
 attached is a patch which should stop kile from making bullshit if there
 are no FIFOs.
 It would be nice if you could try the patch, because I don't have an
 openafs filesystem here.
 Or if I could get access to an openafs filesystem I can try it myself.

I've patched and rebuilt the package (kile_1.9.3-1_i386.deb); it works both 
for me and the user who reported the problem to me: when the option is 
checked, kile no longer consumes all CPU time and an error message is printed 
to the konsole from which kile is started. Thank you very much.

Unfortunately I can't give you AFS access, only the people from our university 
computing centre can do that.


Best regards,
Alexander


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#406470: patch for openafs FIFO problem

2007-03-01 Thread Thomas Braun
On Tuesday 27 February 2007 10:46, Alexander Klauer wrote:
 1. Kile tries to create a FIFO and when this fails, it creates a regular
 file instead:

[snip]
 The regular file messes up the usual select/pipe semantics. It would be
 better (as a short term solution) to show the user a clean error message
 instead, something like Sorry, but this functionality is unavailable
 because the file system of your home directory does not support FIFOs.

Hello Alexander,

attached is a patch which should stop kile from making bullshit if there are 
no FIFOs.
It would be nice if you could try the patch, because I don't have an openafs 
filesystem here.
Or if I could get access to an openafs filesystem I can try it myself.

Thanks
Thomas
Index: kilelyxserver.cpp
===
--- kilelyxserver.cpp	(Revision 637808)
+++ kilelyxserver.cpp	(Arbeitskopie)
@@ -17,6 +17,7 @@
 #include sys/types.h
 #include stdlib.h //getenv
 #include unistd.h //read
+#include fcntl.h
 
 #include kilelyxserver.h
 #include kileactions.h
@@ -70,7 +71,7 @@ bool KileLyxServer::start()
 kdDebug()  Created notifier for   (*it)-name()  endl;
 			}
 			else
-kdDebug()  No notifier created fro   (*it)-name()  endl;
+kdDebug()  No notifier created for   (*it)-name()  endl;
 			++it;
 		}
 		m_running=true;
@@ -81,43 +82,61 @@ bool KileLyxServer::start()
 
 bool KileLyxServer::openPipes()
 {
+	kdDebug()  ===bool KileLyxServer::openPipes()===  endl;
+	
 	bool opened = false;
 	QFileInfo info;
 	QFile *file;
+	struct stat buf;
+	struct stat *stats = buf;
+	mode_t perms = S_IRUSR | S_IWUSR | S_IRGRP| S_IROTH;
 
 	for (uint i=0; i  m_pipes.count(); ++i)
 	{
 		info.setFile(m_pipes[i]);
-		if ( ! info.exists() )
+		if ( !info.exists() )
 		{
-			mode_t perms = S_IRUSR | S_IWUSR | S_IRGRP| S_IROTH;
 			//create the dir first
 if ( ! QFileInfo(info.dirPath(true)).exists() )
-if (mkdir(QFile::encodeName( info.dirPath() ), perms | S_IXUSR) == -1)
-	perror( Could not create directory for pipe );
+if ( mkdir(QFile::encodeName( info.dirPath() ), perms | S_IXUSR) == -1 )
+{
+	kdError()  Could not create directory for pipe  endl;
+	continue;
+}
 else
 	kdDebug()  Created directory   info.dirPath()  endl;
 
-			if (mkfifo(QFile::encodeName( m_pipes[i] ), perms) == -1)
-   perror( Could not create pipe );
+			if ( mkfifo(QFile::encodeName( m_pipes[i] ), perms) != 0 )
+			{
+kdError()  Could not create pipe:   m_pipes[i]  endl;
+continue;
+			}
 			else
-kdDebug()  Created pipe   m_pipes[i]  endl;
+kdDebug()  Created pipe:   m_pipes[i]  endl;
 		}
 
 		file  = new QFile(info.absFilePath());
-		if (!file-open(IO_ReadWrite))
+		info.refresh();
+		if( info.exists()  file-open(IO_ReadWrite) ) // in that order we don't create the file if it does not exist
 		{
-			kdError()  Could not open   info.absFilePath()  endl;
+			kdDebug()  Opened file:   info.absFilePath()  endl;
+			fstat(file-handle(),stats);
+			if( !S_ISFIFO(stats-st_mode) )
+			{
+kdError()  The file we just created is not a FIFO, perhaps we are on some strange filesystem!?  endl;
+file-close();
+continue;
 		}
 		else
-		{
-			kdDebug()  Opened   info.absFilePath()  endl;
+			{	// everything is correct :)
 			m_pipeIn.append(file);
 			m_file.insert(file-handle(),file);
 			opened=true;
 		}
 	}
-
+		else
+			kdError()  Could not open   info.absFilePath()  endl;
+	}
 	return opened;
 }