aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termiolink.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 17:32:29 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 17:32:29 +0000
commitf4c02d3e95924e20575c76aa45bf7dabc02eb618 (patch)
treeb8874a4750a38d54394181daff39972a43b14694 /src/bin/termiolink.c
parentutils: add and use homedir_get() (diff)
downloadterminology-f4c02d3e95924e20575c76aa45bf7dabc02eb618.tar.gz
add termio_cwd_get(), may be useful in future.
When we add multiple tabs or windows, it may be useful to get the cwd to keep context (konsole does that). SVN revision: 77664
Diffstat (limited to 'src/bin/termiolink.c')
-rw-r--r--src/bin/termiolink.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c
index c1e58c1..e523320 100644
--- a/src/bin/termiolink.c
+++ b/src/bin/termiolink.c
@@ -40,16 +40,10 @@ coord_forward(int *x, int *y, int w, int h)
static char *
_cwd_path_get(const Evas_Object *obj, const char *relpath)
{
- char procpath[PATH_MAX], cwdpath[PATH_MAX], tmppath[PATH_MAX];
- pid_t pid = termio_pid_get(obj);
+ char cwdpath[PATH_MAX], tmppath[PATH_MAX];
- snprintf(procpath, sizeof(procpath), "/proc/%d/cwd", pid);
- if (readlink(procpath, cwdpath, sizeof(cwdpath)) < 1)
- {
- ERR("Could not load working directory %s: %s",
- procpath, strerror(errno));
- return NULL;
- }
+ if (!termio_cwd_get(obj, cwdpath, sizeof(cwdpath)))
+ return NULL;
eina_str_join(tmppath, sizeof(tmppath), '/', cwdpath, relpath);
return strdup(tmppath);