summaryrefslogtreecommitdiffstats
path: root/unix/vncpasswd
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-02-07 10:45:15 +0000
committerAdam Tkac <atkac@redhat.com>2011-02-07 10:45:15 +0000
commitaf0817220ee171837b4c15019fe16c2d5de180ad (patch)
treec7915b28be52f72dbcc864dffa42340ff86266e5 /unix/vncpasswd
parenta6da9f388fd66b4f52bedde44dbc2655413e5a4e (diff)
downloadtigervnc-af0817220ee171837b4c15019fe16c2d5de180ad.tar.gz
tigervnc-af0817220ee171837b4c15019fe16c2d5de180ad.zip
[Development] Rename function "gethomedir" to "getvnchomedir" and rewrite it in
platform-intependent manner. Thanks to Guillaume Destuynder. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4252 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/vncpasswd')
-rw-r--r--unix/vncpasswd/vncpasswd.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx
index 4cdff57c..7ba0b225 100644
--- a/unix/vncpasswd/vncpasswd.cxx
+++ b/unix/vncpasswd/vncpasswd.cxx
@@ -102,14 +102,13 @@ int main(int argc, char** argv)
if (!fname) {
char *homeDir = NULL;
- if (gethomedir(&homeDir) == -1) {
- fprintf(stderr, "Can't obtain home directory\n");
+ if (getvnchomedir(&homeDir) == -1) {
+ fprintf(stderr, "Can't obtain VNC home directory\n");
exit(1);
}
- fname = new char[strlen(homeDir) + 20];
- sprintf(fname, "%s/.vnc", homeDir);
- mkdir(fname, 0777);
- sprintf(fname, "%s/.vnc/passwd", homeDir);
+ mkdir(homeDir, 0777);
+ fname = new char[strlen(homeDir) + 7];
+ sprintf(fname, "%spasswd", homeDir);
delete [] homeDir;
}