mirror of
https://github.com/KDE/konsole.git
synced 2026-05-05 05:07:06 -04:00
Add cwd support for DragonFly. Patch by Alex Hornung.
It compiles under Linux. BUG: 259970 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1210984
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include <sys/sysctl.h> //krazy:exclude=includes
|
||||
#include <sys/types.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/syslimits.h>
|
||||
#include <libutil.h>
|
||||
#endif
|
||||
|
||||
@@ -729,8 +730,22 @@ private:
|
||||
virtual bool readCurrentDir(int pid)
|
||||
{
|
||||
#if defined(__DragonFly__)
|
||||
// Not supported in DragonFly
|
||||
return false;
|
||||
char buf[PATH_MAX];
|
||||
int managementInfoBase[4];
|
||||
size_t len;
|
||||
|
||||
managementInfoBase[0] = CTL_KERN;
|
||||
managementInfoBase[1] = KERN_PROC;
|
||||
managementInfoBase[2] = KERN_PROC_CWD;
|
||||
managementInfoBase[3] = pid;
|
||||
|
||||
len = sizeof(buf);
|
||||
if (sysctl(managementInfoBase, 4, buf, &len, NULL, 0) == -1)
|
||||
return false;
|
||||
|
||||
setCurrentDir(buf);
|
||||
|
||||
return true;
|
||||
#else
|
||||
int numrecords;
|
||||
struct kinfo_file* info = 0;
|
||||
|
||||
Reference in New Issue
Block a user