Have the slony share directory come from the
authorSteve Singer <steve@ssinger.info>
Wed, 8 Aug 2018 15:15:11 +0000 (11:15 -0400)
committerSteve Singer <steve@ssinger.info>
Wed, 8 Aug 2018 15:23:38 +0000 (11:23 -0400)
environment variable SLONY_SHARE_DIR not PGHOME.
Also make this happen with or without PGPORT

src/slonik/slonik.c

index 78235f45f2a72659eb022ed387197fdf552d5bad..5f9ff081c0d8f25fcf6ee081895684753d47e143 100644 (file)
@@ -223,18 +223,15 @@ main(int argc, const char *argv[])
                 get_share_path(myfull_path, share_path);
         }
 #else
-       char *pgHome = getenv("PG_HOME");
-       if (pgHome)
+               strcpy(share_path, PGSHARE);
+               
+#endif
+       char *slonyShare = getenv("SLONY_SHARE_DIR");
+       if (slonyShare)
        {
-               snprintf(share_path, MAXPGPATH-1, "%s/share", pgHome);
+               snprintf(share_path, MAXPGPATH-1, "%s", slonyShare);
                share_path[MAXPGPATH-1] = '\0';
        } 
-       else 
-       {
-               strcpy(share_path, PGSHARE);
-       }
-#endif
-printf("Share path is %s\n",share_path);
 
        if (optind < argc)
        {